#include <WinAPI.au3>
$sCursorFile = "a.ani"
$hCursor = _LoadCursorFromFile($sCursorFile)
$hGUI = GUICreate("SetCursor", 400, 300)
$hGC = DllCallbackRegister("_SetCursorProc", "int", "hWnd;uint;wparam;lparam")
$hOGC = _WinAPI_SetWindowLong($hGUI, -4, DllCallbackGetPtr($hGC))
GUISetState()
While GUIGetMsg() <> -3
WEnd
GUIDelete($hGUI)
DllCallbackFree($hGC)
DllCall("User32.dll", "int", "DestroyCursor", "hWnd", $hCursor)
Func _SetCursorProc($hWnd, $iMsg, $iwParam, $ilParam)
DllCall("User32.dll", "hWnd", "SetCursor", "hWnd", $hCursor)
Return _WinAPI_CallWindowProc($hOGC, $hWnd, $iMsg, $iwParam, $ilParam)
EndFunc ;==>_SetCursorProc
Func _LoadCursorFromFile($sCursorFile)
Local $iResult
$iResult = DllCall("User32.dll", "hWnd", "LoadCursorFromFile", "str", $sCursorFile)
Return $iResult[0]
EndFunc ;==>_LoadCursorFromFile
|