IActiveDesktop::GetDesktopItemByID method (shlobj_core.h)

Gets the desktop item that matches the given identification.

Syntax

HRESULT GetDesktopItemByID(
            ULONG_PTR   dwID,
  [in, out] LPCOMPONENT pcomp,
            DWORD       dwReserved
);

Parameters

dwID

Type: ULONG_PTR

An unsigned long integer value that contains the desktop item's identification.

[in, out] pcomp

Type: LPCOMPONENT

The address of the COMPONENT structure of the retrieved desktop item.

dwReserved

Type: DWORD

Reserved. Must be set to zero.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The desktop item's identification is returned in the dwID member of the COMPONENT structure that is returned from the IActiveDesktop::GetDesktopItem method. This identification is only valid until the IActiveDesktop::ApplyChanges method is called. Applications that must retrieve the same desktop item consistently should enumerate the desktop items using the IActiveDesktop::GetDesktopItem and IActiveDesktop::GetDesktopItemCount methods.

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