IActiveDesktop::AddDesktopItem method (shlobj_core.h)

Adds a desktop item.

Syntax

HRESULT AddDesktopItem(
  [in] LPCCOMPONENT pcomp,
       DWORD        dwReserved
);

Parameters

[in] pcomp

Type: LPCCOMPONENT

A pointer to the COMPONENT structure that specifies the item to be added.

dwReserved

Type: DWORD

Reserved. Must be set to zero.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
E_FAIL
Failed to add the desktop item, or an instance of the desktop item already exists on the Active Desktop.
E_INVAILDARG
One or more of the parameters were invalid.
S_OK
Desktop item has been added successfully.

Remarks

The desktop item is added to the desktop, but it does not save it to the registry. The client application must call IActiveDesktop::ApplyChanges separately to update the registry.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlobj_core.h
DLL Shell32.dll (version 4.71 or later)

See also

IActiveDesktop

Using the Active Desktop Object