|
|
Title | Set the system cursor |
Description | This example shows how to set the system cursor in Visual Basic 6. It uses the CopyCursor, LoadCursorFromFile, GetCursor, and SetSystemCursor API functions. |
Keywords | system cursor, cursor |
Categories | Graphics, Windows |
|
|
This program uses the CopyCursor, LoadCursorFromFile, GetCursor, and SetSystemCursor API functions. To display a new system cursor, it uses LoadCursorFromFile to load the cursor. It uses GetCursor to save the old cursor and then sets the new system cursor.
|
|
Private Sub CmdAnimateCursor_Click()
Dim filename As String
' Use the first cursor in this directory.
' Note: Change WinNT to Windows for Win95 or Win98.
filename = "C:\Windows\Cursors\" & _
Dir$("C:\Windows\Cursors\*.ani")
'filename = "C:\WinNT\Cursors\" & _
' Dir$("C:\WinNT\Cursors\*.ani")
' Load the cursor.
new_cursor = LoadCursorFromFile(filename)
old_cursor = GetCursor()
old_cursor = CopyCursor(old_cursor)
SetSystemCursor new_cursor, OCR_NORMAL
End Sub
Private Sub CmdNormalCursor_Click()
SetSystemCursor old_cursor, OCR_NORMAL
End Sub
|
|
|
|
|
|