Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function loads the specified resource into global memory.
HGLOBAL LoadResource( HMODULE hModule , HRSRC hResInfo );
Parameters
Return Values
A handle to the data associated with the resource indicates success. NULL indicates failure. To get extended error information, call GetLastError.
Remarks
The return type of LoadResourceis HGLOBALfor backward compatibility, not because the function returns a handle to a global memory block.
When you are finished using a bitmap, cursor, icon, or menu, you can release its associated memory by calling one of the functions in the following table.
Resource | Release function |
---|---|
Bitmap | DeleteObject |
Cursor | DestroyCursor |
Icon | DestroyIcon |
Menu | DestroyMenu |
The system automatically deletes these resources when the process that loaded them terminates, however, calling the appropriate function saves memory and decreases the size of the process's working set.
Accelerator tables are an exception. They remain in memory until the process terminates.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winbase.h | Coredll.lib, Nk.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
DeleteObject, DestroyCursor, DestroyIcon, DestroyMenu, FindResource, GetLastError, LoadLibrary