找回密码
 加入
搜索
查看: 1241|回复: 2

定时器模拟多线程

[复制链接]
发表于 2020-9-24 22:21:40 | 显示全部楼层 |阅读模式
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[0] Then
                Beep(420,3000)
        EndIf
EndFunc   ;==>Timer

发表于 2020-9-25 02:54:46 | 显示全部楼层
看下大佬写的高级代码
发表于 2023-11-12 10:54:23 | 显示全部楼层
定时器模拟多线程,收藏学习
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 06:38 , Processed in 0.067633 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表