LoadCursorFromFileA function

Creates a cursor based on data contained in a file.

Syntax

HCURSOR LoadCursorFromFileA(
  LPCSTR lpFileName
);

Parameters

lpFileName

Type: LPCTSTR

The source of the file data to be used to create the cursor. The data in the file must be in either .CUR or .ANI format.

If the high-order word of lpFileName is nonzero, it is a pointer to a string that is a fully qualified name of a file containing cursor data.

Return Value

Type: HCURSOR

If the function is successful, the return value is a handle to the new cursor.

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

Return code Description
ERROR_FILE_NOT_FOUND
The specified file cannot be found.

Remarks

DPI Virtualization

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

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

Cursors

LoadCursor

Reference

SetCursor

SetSystemCursor