求一段代码的合并问题
本帖最后由 elexy 于 2009-10-30 16:44 编辑各位大侠,小弟初接触AU3,语法不熟,试验多次仍无法成功生效。下列两段 while 循环,不知道怎么合并才能完美运行。(单独每段的代码均可独立正常运行)
#Include <Constants.au3>
#NoTrayIcon
Opt("TrayMenuMode",1) ; 默认菜单项目将不会显示.
TrayCreateItem("")
$aboutitem = TrayCreateItem("关于")
TrayCreateItem("")
$exititem = TrayCreateItem("退出")
TraySetState()
While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64,"关于:","abcd")
Case $msg = $exititem
ExitLoop
Case $msg = $TRAY_EVENT_PRIMARYDOUBLE
ExitLoop
EndSelect
WEnd
exit
_____________________________________________________
While 1
Switch @hour&@min&@sec
case 150100
if ProcessExists("ttplayer.exe")=0 then
run("D:\Program Files\TTPlayer\TTPlayer.exe")
endif
Case 145500
if ProcessExists("ttplayer.exe")=0 then
run("D:\Program Files\TTPlayer\TTPlayer.exe")
endif
EndSwitch
wend
exit #include <Constants.au3>
#NoTrayIcon
Opt("TrayMenuMode", 1) ; 默认菜单项目将不会显示.
TrayCreateItem("")
$aboutitem = TrayCreateItem("关于")
TrayCreateItem("")
$exititem = TrayCreateItem("退出")
TraySetState()
While 1
Switch @HOUR & @MIN & @SEC
Case 145500
If ProcessExists("ttplayer.exe") = 0 Then Run("D:\Program Files\TTPlayer\TTPlayer.exe")
Case 150100
If ProcessExists("ttplayer.exe") = 0 Then Run("D:\Program Files\TTPlayer\TTPlayer.exe")
EndSwitch
Switch TrayGetMsg()
Case $aboutitem
MsgBox(64, "关于:", "abcd")
Case $exititem
Exit
Case $TRAY_EVENT_PRIMARYDOUBLE
Exit
EndSwitch
WEnd
本帖最后由 elexy 于 2009-10-30 16:46 编辑
谢谢 afan !!代码简洁!!!完美运行!!!
页:
[1]