HotKeySet("{F11}", "ex") ;退出热键为F11
Opt('traymenumode', 1)
Opt('trayoneventmode',1)
$pause = 0
$tz3 = TrayCreateItem('暂停')
TrayCreateItem('')
$tz1 = TrayCreateItem('退出')
TraySetState()
TrayItemSetOnEvent($tz1, 'ex')
trayitemsetonevent($tz3,'zt')
AdlibEnable('pause', 100)
while 1
sleep(1000)
msgbox(0,'','主程序', 1)
WEnd
Func zt()
$pause = Not $pause
If $pause Then
TrayItemSetstate($tz3,65)
Else
TrayItemSetstate($tz3,68)
EndIf
EndFunc
func ex()
Exit
EndFunc
Func pause()
While $pause
Sleep(100)
WEnd
EndFunc
|