自行解决了Func _pause()
$hToolbar = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]")
If @error Then Return 0
$iButCount = _GUICtrlToolbar_ButtonCount($hToolbar)
If $iButCount = 0 Then
TrayTip("错误", "没有找到托盘程序,请手动暂停!",50)
Return 0
EndIf
$hButton = ControlGetHandle("[Class:Shell_TrayWnd]", "", "Button2")
If $hButton <> "" Then ControlClick("[Class:Shell_TrayWnd]", "", "Button2")
For $i = 1 To $iButCount - 1
$text = _GUICtrlToolbar_GetButtonText($hToolbar, $i)
;MsgBox(0,$i,$text)
If String($text) = _Getname() Then ExitLoop
Next
$cID = _GUICtrlToolbar_IndexToCommand($hToolBar,$iButCount - $i - 1)
_GUICtrlToolbar_ClickButton($hToolBar, $cID, "right", True)
EndFunc
|