Advertisement
2_2002-2004 Windows API Call/ Explanation #125489

Animate your program cursor

This little snippet will make the cursor animated. I.E a globe that is spinning.

AI

Resumo por IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Código fonte
original-source
'put this in your Form_Load event or in whatever you would like to trigger the code.
'Note be sure that the cursor you want to use is a Animated cursor.
Dim sCursorFile As String
Dim hCursor As Long
Dim hOldCursor As Long
Dim lReturn As Long
'Pointing to the place where to cursor is.
sCursorFile = App.Path & "\animantedcursor.ani"
hCursor = LoadCursorFromFile(sCursorFile)
'Change the Form1.hwnd to yourformname.hwnd
hOldCursor = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCursor)
'Use this to get back to normal cursor again.
'you can trigger it on form unload event or whatever you want to use to end it.
lReturn = SetClassLong(Form1.hWnd, GCL_HCURSOR, hOldCursor)
Comentários originais (3)
Recuperado do Wayback Machine