HICON CreateIcon(hinst, nWidth, nHeight, bPlanes, bBitsPixel, lpvANDbits, lpvXORbits) | |||||
HINSTANCE hinst; | /* handle of application instance | */ | |||
int nWidth; | /* icon width | */ | |||
int nHeight; | /* icon height, */ | ||||
BYTE bPlanes; | /* number of planes in XOR mask | */ | |||
BYTE bBitsPixel; | /* number of bits per pixel in XOR mask | */ | |||
const void FAR* lpvANDbits; | /* address of AND mask array | */ | |||
const void FAR* lpvXORbits; | /* address of XOR mask array | */ |
The CreateIcon function creates an icon that has the specified width, height, colors, and bit patterns.
hinst
Identifies an instance of the module that will create the icon.
nWidth
Specifies the width, in pixels, of the icon.
nHeight
Specifies the height, in pixels, of the icon.
bPlanes
Specifies the number of planes in the XOR mask of the icon.
bBitsPixel
Specifies the number of bits per pixel in the XOR mask of the icon.
lpvANDbits
Points to an array of bytes that contains the bit values for the AND mask of the icon. This array must specify a monochrome mask.
lpvXORbits
Points to an array of bytes that contains the bit values for the XOR mask of the icon. These bits can be the bits of a monochrome or device-dependent color bitmap.
The return value is the handle of the icon if the function is successful. Otherwise, it is NULL.
The nWidth and nHeight parameters must specify a width and height supported by the current display driver, since the system cannot create icons of other sizes. An application can determine the width and height supported by the display driver by calling the GetSystemMetrics function, specifying the SM_CXICON or SM_CYICON constant.
Before terminating, an application must call the DestroyIcon function to free system resources associated with the icon.