Skip to content

Instantly share code, notes, and snippets.

@tmplinshi
Created August 23, 2022 04:50
Show Gist options
  • Save tmplinshi/1853be1d869413f4f81747c9fd7c4ba7 to your computer and use it in GitHub Desktop.
Save tmplinshi/1853be1d869413f4f81747c9fd7c4ba7 to your computer and use it in GitHub Desktop.
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"))
Menu, MyMenu, Show
Return
Label() {
MsgBox, % A_ThisMenuItem
}
MyTimer() {
DllCall("KillTimer", "Ptr", A_ScriptHwnd, "Ptr", id := 1)
Menu, MyMenu, Enable , Item 1
Menu, MyMenu, Disable, Item 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment