windows_programming_notes.nbk: Home | Index | Next Page: LoadImage | Previous Page: ListView_SortItemsEx


 LoadCursor

The LoadCursor function loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

Note: This function has been superseded by the LoadImage function.

Syntax

    HCURSOR LoadCursor(  
        HINSTANCE hInstance,
        LPCTSTR lpCursorName
    );

Parameters

Return Value

If the function succeeds, the return value is the handle to the newly loaded cursor.

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

Remarks

The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to the existing resource. This function returns a valid cursor handle only if the lpCursorName parameter is a pointer to a cursor resource. If lpCursorName is a pointer to any type of resource other than a cursor (such as an icon), the return value is not NULL, even though it is not a valid cursor handle.

The LoadCursor function searches the cursor resource most appropriate for the cursor for the current display device. The cursor resource can be a color or monochrome bitmap.

Windows 95/98/Me: LoadCursorW 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: LoadImage | Previous Page: ListView_SortItemsEx


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