这的确是个难题,本来想用模拟鼠标点击的#Include <GuiToolBar.au3>
_SysTray_ClickItem("360安全卫士","right")
Send("{UP}")
Sleep(2000)
Send("{ENTER}")
Func _SysTray_ClickItem($iTitle, $iButton = "left", $iClick = 1, $sMove = False, $iSpeed = 1)
Local $hToolbar, $iButCount, $hButton, $cID, $i
$hToolbar = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]");获取系统托盘的句柄
$iButCount = _GUICtrlToolbar_ButtonCount($hToolbar);返回托盘按钮数量
;从0开始遍历托盘按钮
For $i=0 To $iButCount-1
$cID = _GUICtrlToolbar_IndexToCommand($hToolbar, $i);由于_GUICtrlToolbar_ClickButton只支持CommandID,所以先获取
;判断要点击的文本是不是当前获取的文本
If StringInStr(_GUICtrlToolbar_GetButtonText($hToolbar, $cID), $iTitle) Then
_GUICtrlToolbar_ClickButton($hToolbar,$cID,$iButton,$sMove,$iClick,$iSpeed)
EndIf
Next
EndFunc
点其他程序都可以,就是360写了保护的,希望高手指点一二 |