HBITMAP LoadBitmap(hinst, lpszBitmap) | |||||
HINSTANCE hinst; | /* handle of application instance | */ | |||
LPCSTR lpszBitmap; | /* address of bitmap name | */ |
The LoadBitmap function loads the specified bitmap resource from the given module's executable file.
hinst
Identifies the instance of the module whose executable file contains the bitmap to be loaded.
lpszBitmap
Points to a null-terminated string that contains the name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can be used to create this value.
The return value is the handle of the specified bitmap if the function is successful. Otherwise, it is NULL.
If the bitmap pointed to by lpszBitmap does not exist or if there is insufficient memory to load the bitmap, the function fails.
The application must call the DeleteObject function to delete each bitmap handle returned by the LoadBitmap function. This also applies to the following predefined bitmaps.
An application can use the LoadBitmap function to access the predefined bitmaps used by Windows. To do so, the application must set the hinst parameter to NULL and the lpszBitmap parameter to one of the following values:
OBM_BTNCORNERS
OBM_BTSIZE
OBM_CHECK
OBM_CHECKBOXES
OBM_CLOSE
OBM_COMBO
OBM_DNARROW
OBM_DNARROWD
OBM_DNARROWI
OBM_LFARROW
OBM_LFARROWD
OBM_LFARROWI
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_RGARROWI
OBM_SIZE
OBM_UPARROW
OBM_UPARROWD
OBM_UPARROWI
OBM_ZOOM
OBM_ZOOMD
Bitmap names that begin with OBM_OLD represent bitmaps used by Windows versions earlier than 3.0.
The bitmaps identified by OBM_DNARROWI, OBM_LFARROWI, OBM_RGARROWI, and OBM_UPARROWI are new for Windows 3.1. These bitmaps are not found in device drivers for previous versions of Windows.
Note that for an application to use any of the OBM_ constants, the constant OEMRESOURCE must be defined before the WINDOWS.H header file is included.
The following shows the appearance of each of the OBM_ bitmaps.