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


 LoadImage

Loads an icon, cursor, animated cursor, or bitmap.

Syntax

    HANDLE LoadImage(  
        HINSTANCE hinst,
        LPCTSTR lpszName,
        UINT uType,
        int cxDesired,
        int cyDesired,
        UINT fuLoad
    );

Parameters

Return Value

If the function succeeds, the return value is the handle of the newly loaded image.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

When you are finished using a bitmap, cursor, or icon you loaded without specifying the LR_SHARED flag, you can release its associated memory by calling one of the functions in the following table.

The system automatically deletes these resources when the process that created them terminates; however, calling the appropriate function saves memory and decreases the size of the process's working set.

Windows 95/98/Me: LoadImageW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .

Function Information


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


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