定时器模拟多线程
Local $Timer = DllCallbackRegister("_Timer", "int", "hwnd;uint;uint;dword")Local $TimerDLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 9, "int", 10, "ptr", DllCallbackGetPtr($Timer))
;返回值:类型:UINT_PTR hWnd参数为0,则返回新建立的时钟编号
MsgBox(0, "双重提示:", "测试",3)
DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $TimerDLL)
DllCallbackFree($Timer)
Func _Timer($hWnd, $uiMsg, $idEvent, $dwTime)
If $idEvent = $TimerDLL Then
Beep(420,3000)
EndIf
EndFunc ;==>Timer
看下大佬写的高级代码 定时器模拟多线程,收藏学习
页:
[1]