Skip to content

Latest commit

 

History

History
128 lines (93 loc) · 5.15 KB

nf-winuser-loadcursora.md

File metadata and controls

128 lines (93 loc) · 5.15 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winuser.LoadCursorA
LoadCursorA function (winuser.h)
Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. (ANSI)
LoadCursorA
winuser/LoadCursorA
menurc\loadcursor.htm
menurc
VS|winui|~\winui\windowsuserinterface\resources\cursors\cursorreference\cursorfunctions\loadcursor.htm
12/05/2018
LoadCursor, LoadCursor function [Menus and Other Resources], LoadCursorA, LoadCursorW, _win32_LoadCursor, _win32_loadcursor_cpp, menurc.loadcursor, winui._win32_loadcursor, winuser/LoadCursor, winuser/LoadCursorA, winuser/LoadCursorW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
LoadCursorW (Unicode) and LoadCursorA (ANSI)
User32.lib
User32.dll
Windows
19H1
LoadCursorA
winuser/LoadCursorA
c++
APIRef
kbSyntax
DllExport
User32.dll
Ext-MS-Win-NTUser-GUI-l1-1-0.dll
Ext-MS-Win-NTUser-GUI-l1-1-1.dll
Ext-MS-Win-NTUser-GUI-l1-2-0.dll
api-ms-win-ntuser-ie-gui-l1-1-0.dll
ie_stubs.dll
ext-ms-win-ntuser-gui-l1-2-1.dll
Ext-MS-Win-RTCore-NTUser-Cursor-L1-1-0.dll
MinUser.dll
LoadCursor
LoadCursorA
LoadCursorW

LoadCursorA function

-description

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 (with LR_DEFAULTSIZE and LR_SHARED flags set).

-parameters

-param hInstance [in, optional]

Type: HINSTANCE

A handle to the module of either a DLL or executable (.exe) file that contains the cursor to be loaded. For more information, see GetModuleHandle.

To load a predefined system cursor, set this parameter to NULL.

-param lpCursorName [in]

Type: LPCTSTR

If hInstance is non-NULL, lpCursorName specifies the cursor resource either by name or ordinal. This ordinal must be packaged by using the MAKEINTRESOURCE macro.

If hInstance is NULL, lpCursorName specifies the identifier (beginning with the IDC_ prefix) of a predefined system cursor to load.

-returns

Type: HCURSOR

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.

DPI Virtualization

This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread.

Examples

For an example, see Creating a Cursor.

Note

The winuser.h header defines LoadCursor as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Conceptual

Cursors

LoadImage

MAKEINTRESOURCE

IS_INTRESOURCE

Reference

SetCursor

SetCursorPos

ShowCursor