Menu, MyMenu, Add, Item 1, Label
Menu, MyMenu, Disable, Item 1
Menu, MyMenu, Add, Item 2, Label
DllCall("SetTimer", "Ptr", A_ScriptHwnd, "Ptr", 定时器id := 1, "UInt", 2000, "Ptr", RegisterCallback("MyTimer", "F"))
; SetTimer MyTimer, -2000 ; 在Menu下,自带SetTimer失效
Menu, MyMenu, Show
Return
; https://www.autohotkey.com/boards/viewtopic.php?p=478308#p478308
Label() {
MsgBox, % A_ThisMenuItem
}
MyTimer() {
DllCall("KillTimer", "Ptr", A_ScriptHwnd, "Ptr", 定时器id := 1) ; 不设置停止就是每两秒循环一次
Menu, MyMenu, Enable , Item 1
Menu, MyMenu, Disable, Item 2
}
声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。

评论(0)