Jump to content

Double click icon in system tray


Taps
 Share

Recommended Posts

Hello, I need doubleclick icon in system tray.  I used this script, but now work. I have win 10. I'm beginner on scripting autoit. Can I help me, please? Thank you very much.

_SysTrayIconTitles () is empty


 

#include<SysTray_UDF.au3>
#include<Array.au3>


Global $title = "ShareX"

clickSysTray($title, "right")

Func clickSysTray($winTitle, $click = "left", $times = 1)
    Local $a = _SysTrayIconTitles ()
    Local $p = MouseGetPos()
    For $i = 1 To UBound($a) - 1
        If $a[$i] = $title Then
            $pos = _SysTrayIconPos ($i)
            MouseClick($click, $pos[0], $pos[1], $times, 1)
            sleep(1000)
            MouseClick($click, $pos[0], $pos[1], $times, 1)
            ExitLoop
        EndIf
    Next
    MouseMove($p[0], $p[1], 1)
 EndFunc   ;

 

Edited by Taps
Link to comment
Share on other sites

what behavior you see on double click? Open the Application?

If It is. you could execute it. 

 

ShellExecute("C:\Users\" & @UserName & "\Desktop\ShareX.lnk")

Saludos

Link to comment
Share on other sites

ShareX was just an example. When I click on my application's icons on the desktop, the application immediately appears in the system tray. If I click on the icon on the desktop repeatedly, I will see information that the application is already running

Link to comment
Share on other sites

18 hours ago, Taps said:

clickSysTray($title, "right")

That should perform a right click. Does it? If you want to perform a double click, you should change that line to

clickSysTray($title, "left", 2)

If that doesn't solve your problem, then you'll come back with more details than "doesn't work". 😉

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...