回复 1# nop
参考了这里.
http://www.autoitscript.com/forum/topic/106169-tray-icon-click/
#include "SysTray_UDF.au3"
;Left-click Feedreader's icon on system tray
; Press hide inactive icon's button part is from Valik's refresh system tray script!
$oldMatchMode = Opt("WinTitleMatchMode", 4)
$oldChildMode = Opt("WinSearchChildren", 1)
$class = "classname=Shell_TrayWnd"
$hControl = ControlGetHandle($class, "", "Open Skype")
; get tray position and move there. Helps if Auto Hide tray option is used.
$posTray = WinGetPos(_FindTrayToolbarWindow ())
MouseMove($posTray[0], $posTray[1])
$index = _SysTrayIconIndex ("QQ.exe"); Change this to some other application if needed
If $index <> -1 Then
$pos = _SysTrayIconPos ($index)
If $pos = -1 Then
; ***** Moved by CatchFish *****
; If XP and the Hide Inactive Icons mode is active
If $hControl <> "" And ControlCommand($class, "", $hControl, "IsVisible", "") Then
ControlClick($class, "", $hControl)
Sleep(250); Small delay to allow the icons to be drawn
EndIf
; ******************************
$pos = _SysTrayIconPos ($index)
If $pos = -1 Then Exit ; ** A real error this time;)
EndIf
MouseMove($pos[0], $pos[1])
Sleep(1000)
MouseClick("right")
MouseMove($pos[0] - 50 , $pos[1] - 200)
MouseClick("left")
EndIf
|