Jump to content

click only left trey icon,why ?


Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...