本帖最后由 zzmxd 于 2012-9-1 21:50 编辑
就像这样,几个如果调换顺序,总有一些代码失效,该如何让他们都能生效?While 1
Local $msg = TrayGetMsg()
Local $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE)
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
Local $i = 0
Do
ProcessSetPriority ( "1.exe", 3 )
Sleep (1000)
$i = $i + 1
Until $i = 10
EndSwitch
Select
Case $msg = 0
ContinueLoop
Case $msg = $prefsitem1
GUISetState(@SW_SHOWNORMAL)
Case $msg = $prefsitem2
GUISetState(@SW_HIDE)
Case $msg = $aboutitem
MsgBox(64, "关于:", "http://www.autoitx.com/")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd
TraySetState()
Example()
Func Example()
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "TrayEvent")
TraySetState(1) ; Show the tray menu.
While 1
Sleep(100) ; 空闲循环
WEnd
EndFunc ;==>Example
Func TrayEvent()
Switch @TRAY_ID ; Check the last tray item identifier.
Case $TRAY_EVENT_PRIMARYDOUBLE
; Display a message box about the AutoIt version and installation path of the AutoIt executable.
MsgBox(4096, "", "AutoIt tray menu example." & @CRLF & @CRLF & _
"Version: " & @AutoItVersion & @CRLF & _
"Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "", 0, -1) - 1)) ; Find the folder of a full path.
EndSwitch
EndFunc ;==>TrayEvent
Func ExitScript()
Exit
EndFunc
不是while语句无法运行,就是func语句无法运行。 |