LoadResource

Syntax

HANDLE LoadResource(hInstance,hResInfo)

This function loads a resource identified by the hResInfo parameter from the executable file associated with the module specified by the hInstance parameter. The function loads the resource into memory only if it has not been previously loaded. Otherwise, it retrieves a handle to the existing resource.

Parameter Type/Description  

hInstance HANDLE Identifies an instance of the module whose executable file contains the resource.  
hResInfo HANDLE Identifies the desired resource. This handle is assumed to have been created by using the FindResource function.  

Return Value

The return value identifies the global memory block to receive the data associated with the resource. It is NULL if no such resource exists.

Comments

The resource is not actually loaded until the LockResource function is called to translate the handle returned by LoadResource into a far pointer to the resource data.