Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Any) As Long
Platforms: Win 32s, Win 95/98, Win NT
LoadCursor loads a cursor from either a currently running program's cursor resources or Windows's cursor resources. The cursor can be referenced either by its resource name or by its numeric resource ID number. If successful, the function returns a handle to the loaded cursor. If unsuccessful, the function returns 0.
Example:
' Display the application starting (arrow and hourglass) Windows
' cursor for three seconds. The cursor resource is loaded from Windows. Then
' restore the old cursor (whatever it happens to be).
Dim hcursor As Long ' receives handle to application starting cursor
Dim holdcursor As Long ' receives handle to previously used cursor
Dim retval As Long ' throw-away return value
hcursor = LoadCursor(0, IDC_APPSTARTING) ' load Windows's application starting cursor
holdcursor = SetCursor(hcursor) ' set it to the new cursor
Sleep 3000 ' wait for 3 seconds
retval = SetCursor(holdcursor) ' set it to the previous cursor
See Also: LoadCursorFromFile
Category: Cursor
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/l/loadcursor.html