LoadBitmap

Syntax

HBITMAP LoadBitmap(hInstance,lpBitmapName)

This function loads the bitmap resource named by the lpBitmapName parameter from the executable file associated with the module specified by the hInstance parameter.

Parameter Type/Description  

hInstance HANDLE Identifies the instance of the module whose executable file contains the bitmap.  
lpBitmapName LPSTR Points to a character string that names the bitmap. The string must be a null-terminated character string.  

Return Value

The return value identifies the specified bitmap. It is NULL if no such bitmap exists.

Comments

The application must call the DeleteObject function to delete each bitmap handle returned by the LoadBitmap function. This also applies to the predefined bitmaps described in the following paragraph.

The LoadBitmap function can also be used to access the predefined bitmaps used
by Windows. The hInstance parameter must be set to NULL, and the lpBitmapName
parameter must be one of the following values:

OBM_BTNCORNERS  
OBM_BTSIZE  
OBM_CHECK  
OBM_CHECKBOXES  
OBM_CLOSE  
OBM_COMBO  
OBM_DNARROW  
OBM_DNARROWD  
OBM_LFARROW  
OBM_LFARROWD  
OBM_MNARROW  
OBM_OLD_CLOSE  
OBM_OLD_DNARROW  
OBM_OLD_LFARROW  
OBM_OLD_REDUCE  
OBM_OLD_RESTORE  
OBM_OLD_RGARROW  
OBM_OLD_UPARROW  
OBM_OLD_ZOOM  
OBM_REDUCE  
OBM_REDUCED  
OBM_RESTORE  
OBM_RESTORED  
OBM_RGARROW  

OBM_RGARROWD  
OBM_SIZE  
OBM_UPARROW  
OBM_UPARROWD  
OBM_ZOOM  
OBM_ZOOMD  

Bitmap names that begin OBM_OLD represent bitmaps used by Windows versions prior to 3.0.

The lpBitmapName parameter can also be a value created by the MAKEINTRESOURCE macro. If it is, the ID must reside in the low-order word of lpBitmapName, and the high-order word must contain zeros.