Sign in to follow this  
Followers 0
selevo

click only left trey icon,why ?

4 posts in this topic

#1 ·  Posted (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 by selevo

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

SysTrayIconIndex always returns -1

In the settings made "not to hide tray icon"

Edited by AZJIO

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0