本帖最后由 半芯竹 于 2012-1-9 23:41 编辑 #include "SysTray.au3"
Opt("WinSearchChildren", 1)
_SysTray_ClickItem("qq.exe", "right", 1)
Func _SysTray_ClickItem($iTitle, $iButton = "left", $iClick = 1)
Local $k_pos = MouseGetPos()
Local $posTray = WinGetPos(_FindTrayToolbarWindow())
Local $index = _SysTrayIconIndex($iTitle)
If $index <> -1 Then
Local $pos = _SysTrayIconPos($index)
If $pos = -1 Then
$pos = _SysTrayIconPos($index)
If $pos = -1 Then Exit
EndIf
MouseMove($pos[0], $pos[1], 0)
Sleep(100)
MouseClick("right")
MouseMove($k_pos[0], $k_pos[1], 0)
Else
MsgBox(0,'错误提示','未找到指定程序,请确定是否正确运行了此程序')
EndIf
EndFunc ;==>_SysTray_ClickItem
以下为SysTray.au3 自己保存在程序运行目录。
|