HCURSOR LoadCursorFromFile( LPCTSTR lpFileName);
HICON CreateIconIndirect( PICONINFO piconinfo);typedef struct _ICONINFO { BOOL fIcon; DWORD xHotspot; DWORD yHotspot; HBITMAP hbmMask; HBITMAP hbmColor;} ICONINFO;MembersfIconSpecifies whether this structure defines an icon or a cursor. A value of TRUE specifies an icon; FALSE specifies a cursor. xHotspotSpecifies the x-coordinate of a cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.yHotspotSpecifies the y-coordinate of the cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored. hbmMaskSpecifies the icon bitmask bitmap. If this structure defines a black and white icon, this bitmask is formatted so that the upper half is the icon AND bitmask and the lower half is the icon XOR bitmask. Under this condition, the height should be an even multiple of two. If this structure defines a color icon, this mask only defines the AND bitmask of the icon. hbmColorHandle to the icon color bitmap. This member can be optional if this structure defines a black and white icon. The AND bitmask of hbmMask is applied with the SRCAND flag to the destination; subsequently, the color bitmap is applied (using XOR) to the destination by using the SRCINVERT flag.
The CreateIconFromResourceEx function creates an icon or cursor from resource bits describing the icon. HICON CreateIconFromResourceEx( PBYTE pbIconBits, DWORD cbIconBits, BOOL fIcon, DWORD dwVersion, int cxDesired, int cyDesired, UINT uFlags);ParameterspbIconBits[in] Pointer to a buffer containing the icon or cursor resource bits. These bits are typically loaded by calls to the LookupIconIdFromDirectoryEx and LoadResource functions. cbIconBits[in] Specifies the size, in bytes, of the set of bits pointed to by the pbIconBits parameter. fIcon[in] Specifies whether an icon or a cursor is to be created. If this parameter is TRUE, an icon is to be created. If it is FALSE, a cursor is to be created. dwVersion[in] Specifies the version number of the icon or cursor format for the resource bits pointed to by the pbIconBits parameter. This parameter can be 0x00030000. cxDesired[in] Specifies the desired width, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width. cyDesired[in] Specifies the desired height, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the height. uFlags[in] Specifies a combination of the following values: LR_DEFAULTCOLORUses the default color format.LR_DEFAULTSIZEUses the width or height specified by the system metric values for cursors or icons, if the cxDesired or cyDesired values are set to zero. If this flag is not specified and cxDesired and cyDesired are set to zero, the function uses the actual resource size. If the resource contains multiple images, the function uses the size of the first image.LR_MONOCHROMECreates a monochrome icon or cursor. LR_SHAREDShares the icon or cursor handle if the icon or cursor is created multiple times. If LR_SHARED is not set, a second call to CreateIconFromResourceEx for the same resource will create the icon or cursor again and return a different handle.When you use this flag, the system will destroy the resource when it is no longer needed. Do not use LR_SHARED for icons or cursors that have non-standard sizes, that may change after loading, or that are loaded from a file.When loading a system icon or cursor, you must use LR_SHARED or the function will fail to load the resource.Windows 95/98/Me: The function finds the first image with the requested resource name in the cache, regardless of the size requested.