IActiveDesktop::AddDesktopItem method

Adds a desktop item.

Syntax


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

Parameters

pcomp [in]

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 codeDescription
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 succesfully.

 

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

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlobj.h

DLL

Shell32.dll (version 4.71 or later)

See also

Using the Active Desktop Object
IActiveDesktop

 

 

Show: