windows_programming_notes.nbk: Home | Index | Next Page: LOGBRUSH | Previous Page: LoadResource


 LockResource

Locks the specified resource in memory.

Syntax

    LPVOID LockResource(
        HGLOBAL hResData
    );

Parameters

Return Value

If the loaded resource is locked, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.

Remarks

The pointer returned by LockResource is valid until the module containing the resource is unloaded. It is not necessary to unlock resources because the system automatically deletes them when the process that created them terminates.

Do not try to lock a resource by using the handle returned by the FindResource or FindResourceEx function. Such a handle points to random data.

Function Information


windows_programming_notes.nbk: Home | Index | Next Page: LOGBRUSH | Previous Page: LoadResource


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time