VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to set system cursor from selected cursor file or animation cursor file

by Mohannad Sulaiman Abu Sall (4 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st September 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to set system cursor from selected cursor file or animation cursor file

API Declarations



Private Const OCR_NORMAL = 32512

Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Long
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function GetCursor Lib "user32" () As Long

Dim CurCursor As Long
Dim modCurName As String
Dim modCur As Long

Rate How to set system cursor from selected cursor file or animation cursor file



SetSystemCursor CurCursor, OCR_NORMAL 'Restore Default Cursor
End Sub

Private Sub Command2_Click()

modCurName = "c:\test.cur" 'Or c:\test.ani
modCur = LoadCursorFromFile(modCurName)
SetSystemCursor modCur, OCR_NORMAL

End Sub

Private Sub Form_Load()

CurCursor = GetCursor() 'Store Default Cursor

End Sub


Download this snippet    Add to My Saved Code

How to set system cursor from selected cursor file or animation cursor file Comments

No comments have been posted about How to set system cursor from selected cursor file or animation cursor file. Why not be the first to post a comment about How to set system cursor from selected cursor file or animation cursor file.

Post your comment

Subject:
Message:
0/1000 characters