Share via


LoadBitmap

This function loads the specified bitmap resource from a modules executable file.

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).

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Loadbmp.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CreateBitmap, DeleteObject, GetLastError, LoadIcon, MAKEINTRESOURCE

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.