Directory Services

IDsDisplaySpecifier::GetIcon

The IDsDisplaySpecifier::GetIcon method obtains the icon for a given object class.

HICON GetIcon( 
  LPCWSTR pszObjectClass,
  DWORD dwFlags,
  INT cxIcon,
  INT cyIcon
);

Parameters

pszObjectClass
[in] Pointer to a null-terminated Unicode string that contains the name of the object class to obtain the icon for. Examples of the object class name are "user" and "container".
dwFlags
[in] Contains a set of flags that indicate the type of icon to retrieve. This can be a combination of one or more of the following values.
Value Meaning
DSGIF_ISNORMAL Obtains the normal icon for the object class.
DSGIF_ISOPEN Obtains the open icon, such as an open folder, for the object class. If the object class does not have an open icon, this method attempts to obtain the normal icon for the object class.
DSGIF_ISDISABLED Obtains the disabled icon, such as a disabled user, for the object class. If the object class does not have a disabled icon, this method attempts to obtain the normal icon for the object class.
DSGIF_ISMASK Used to mask off the DSGIF_ISNORMAL, DSGIF_ISOPEN and DSGIF_ISDISABLED flags.
DSGIF_GETDEFAULTICON If no icon can be found for the object class, this method returns a default icon. If this flag is not specified and no icon can be found for the object class, this method returns NULL.
DSGIF_DEFAULTISCONTAINER If no icon can be found for the object class, this method will return the container icon as the default icon. If this flag is not specified and no icon can be found for the object class, this method returns NULL.
cxIcon
[in] Contains the desired width, in pixels, of the icon. This method obtains the icon that most closely matches this width.
cyIcon
[in] Contains the desired height, in pixels, of the icon. This method obtains the icon that most closely matches this height.

Return Values

Returns a handle to the icon, if successful, or NULL otherwise. The caller must destroy this icon when it is no longer required by passing this handle to DestroyIcon.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Dsclient.h.

See Also

DestroyIcon, IDsDisplaySpecifier, Active Directory Display Interfaces