LoadBitmap

This function loads the specified bitmap resource from a module’s executable file.

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

Syntax

HBITMAP LoadBitmap(HINSTANCE hInstance, LPCTSTR lpBitmapName);

Parameters

hInstance

[in] Handle to the instance of the module whose executable file contains the bitmap to be loaded.

lpBitmapName

[in] Long pointer 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.

Return Values

The handle to the specified bitmap indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

If the bitmap pointed to by the lpBitmapName parameter does not exist or 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.

Windows CE version 1.0 supports only a 2 bit gray scale palette, so use only a bitmap that is 1 bit per pixel (monochrome .bmp) or 2 bits per pixel (.2bp).

See Also

CreateBitmap, DeleteObject, LoadIcon, MAKEINTRESOURCE