Re: Using Animated Cursors
private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (byval lpFileName as string) as Long
private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (byval hwnd as Long, byval nIndex as Long, byval dwNewLong as Long) as Long
Const GCL_HCURSOR = (-12)
Dim hCurOld as Long
private Sub Form_Load()
Dim hCur as Long
hCur = LoadCursorFromFile("c:\winnt\cursors\metronom.ani")
hCurOld = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCur)
End Sub
private Sub Form_Unload(Cancel as Integer)
Dim hCur as Long
hCur = SetCursor(hCurOld)
End Sub
Re: Using Animated Cursors
Thank you for the code. It works great.
What is the code for the SetCursor function?
It is called in the Form_Unload event but I don't
know what the code is so I get an error.
Kris
Software Engineer
Phoenix,AZ
Re: Using Animated Cursors
Delete all Form_Unload code. Sorry, this is only test SetCursor function. This function not working in VB and i found other way to create cursor.