selevo Posted July 20, 2012 Posted July 20, 2012 (edited) Ckliking always only left icon but "BtTray.exe" 3-th of left icon why ? #NoTrayIcon #include <SysTray_UDF.au3>; $Pid = ProcessExists("BtTray.exe") If Not $Pid Then MsgBox(16, "Error", "This process not exist") Exit EndIf $Index = _SysTrayIconIndex($Pid) If @error Then MsgBox(16, "Error", "This process not have tray icon") Exit EndIf ;_SysTrayIconIndex($Pid) _SysTrayIconClick($Index, "Right") If @error Then MsgBox(16, "Error", "There was an error to click on the icon") Exit EndIf Func _SysTrayIconClick($iIndex, $sButton="main") Local $TrayIcon_Pos = _SysTrayIconPos($iIndex) If Not IsArray($TrayIcon_Pos) Then Return SetError(1, 0, 0) Local $Old_Mouse_Pos = MouseGetPos() MouseClick($sButton, $TrayIcon_Pos[0], $TrayIcon_Pos[1],1, 60) ; MouseMove($Old_Mouse_Pos[0], $Old_Mouse_Pos[1], 0) EndFunc Edited July 20, 2012 by selevo
JohnOne Posted July 20, 2012 Posted July 20, 2012 I think it's because a line 17 in your _SysTrayIconPos function AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
AZJIO Posted July 20, 2012 Posted July 20, 2012 (edited) SysTrayIconIndex always returns -1 In the settings made "not to hide tray icon" Edited July 20, 2012 by AZJIO My other projects or all
selevo Posted July 20, 2012 Author Posted July 20, 2012 work it's : #include <SysTray_UDF.au3> $var1="AdvOR.exe"; имя процесса ConsoleWrite("var1="& $var1 & " ") $var2=0 $var3=1 $var4=_SysTrayIconIndex($var1) $var5=_SysTrayIconPos($var4) ConsoleWrite("var5="& $var5 & " ") MouseClick("right", $var5[0]+2,$var5[1]+2,1,0)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now