void FAR* LockResource(hglb) | ||||
HGLOBAL hglb; | /* handle of resource, */ |
The LockResource function locks the given resource. The resource is locked in memory and its reference count is incremented (increased by one). The locked resource is not subject to discarding.
hglb
Identifies the resource to be locked. This handle must have been created by using the LoadResource function.
The return value points to the first byte of the loaded resource if the function is successful. Otherwise, it is NULL.
The resource remains locked in memory until its reference count is decreased to zero by calls to the FreeResource function.
If the resource identified by the hglb parameter has been discarded, the resource-handler function (if any) associated with the resource is called before the LockResource function returns. The resource-handler function can recalculate and reload the resource if necessary. After the resource-handler function returns, LockResource makes another attempt to lock the resource and returns with the result.
Using the handle returned by the FindResource function for the hglb parameter causes an error.
Use the UnlockResource macro to unlock a resource that was locked by LockResource.