Microsoft KB Archive/108234

DOCERR: LoadCursorFromFile and SetSystemCursor Are Missing PSS ID Number: Q108234 Article last modified on 07-27-1994

3.10

WINDOWS NT

= SUMMARY =

The following application programming interfaces (APIs) are included in Windows NT 3.1, but are not documented in the 3.1 SDK. The APIs are documented in the 3.5 SDK.

= MORE INFORMATION =

LoadCursorFromFile
HCURSOR LoadCursorFromFile( lpszFilename )

LPWSTR lpszFilename; /* address of file name of cursor file */

Loads and creates a cursor from the specified file and returns a handle to the new cursor. When multiple cursors reside in the specified file, the cursor that is most appropriate for the current display device is loaded. The API returns NULL for failure.

The file may be in either .CUR or .ANI format.

If the high word of lpszFilename is zero, lpszFilename is assumed to be a system cursor ID. Then the [Cursors] entry in WIN.INI is searched for the file associated with the name of the system cursor.

System cursor names and their associated IDs are:

“Arrow” OCR_NORMAL “IBeam” OCR_IBEAM “Wait” OCR_WAIT “Crosshair” OCR_CROSS “UpArrow” OCR_UP “Size” OCR_SIZE “Icon” OCR_ICON “SizeNWSE” OCR_SIZENWSE “SizeNESW” OCR_SIZENESW “SizeWE” OCR_SIZEWE “SizeNS” OCR_SIZENS “SizeAll” OCR_SIZEALL “No” OCR_SIZENO “AppStarting” OCR_APPSTARTING

For example, if WIN.INI contains the following

[Cursors] Arrow = “arrow.ani”

then LoadCursorFromFile( (LPWSTR)OCR_NORMAL ) will load the cursor from the file ARROW.ANI.

SetSystemCursor
BOOL SetSystemCursor( hCursor, dwCursorId )

HCURSOR hCursor; /* handle of cursor / DWORD dwCursorId; / cursor ID */

Replaces the contents of the system cursor specified by dwCursorId with the contents of the cursor specified by hCursor and then destroys hCursor. The API returns TRUE for success.

Valid cursor IDs are:

OCR_NORMAL OCR_IBEAM OCR_WAIT OCR_CROSS OCR_UP OCR_SIZE OCR_ICON OCR_SIZENWSE OCR_SIZENESW OCR_SIZEWE OCR_SIZENS OCR_SIZEALL OCR_SIZENO OCR_APPSTARTING

Additional reference words: 3.10 KBCategory: Prg KBSubcategory: GdiCurico

=
================================================================

Copyright Microsoft Corporation 1994.