Jump to content
Sign in to follow this  
Who

show programs in tray menu ?

Recommended Posts

Who

I'm new to AutoIT and I'm confusing about a question : If I'm having some programs are minimized in tray icon ( e.g : Yahoo! Messenger ), are there anyway for me to maximize them :whistle: ? Thanks :lmao:

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

#include<Systray.au3>

Global $title = "XXX"
;Global $prcoess = "icqlite.exe"
Global $prcoess = "winampa.exe"

;clickSysTrayByTitle($title, "right")
clickSysTrayByProcess($prcoess, "right")

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

Func clickSysTrayByProcess($winProcess, $click = "left", $times = 1)
    If Not ProcessExists($winProcess) Then Return -1
    Local $a = _SysTrayIconProcesses ()
    Local $p = MouseGetPos()
    For $i = 0 To UBound($a) - 1
        If $a[$i] = $winProcess Then
            $pos = _SysTrayIconPos ($i)
            MouseClick($click, $pos[0], $pos[1], $times, 1)
            ExitLoop
        EndIf
    Next
    MouseMove($p[0], $p[1], 1)
EndFunc  ;==>clickSysTrayByProcess

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
Who

Thanks but when I tried your code, it returned this :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\d.au3"    
Info: 198424RECT[0](left): 836RECT[1](top): 746RECT[2](right): 854RECT[3](bottom): 764
>Exit code: 0   Time: 0.209

I tested with the Yahoo! Messenger. When opened first time, both tray icon and YM were shown and it showed the menu of the traying program. But after I closed the YM and remained the tray icon, it wouldn't work at all. Can you take a look at it please ?

Edited by Who

Share this post


Link to post
Share on other sites
Who

Yay, I have figured it out and it works very well :lmao:.But the only problem is if there are more than 1 process then the script will show only 1 :whistle:. Can you make this more please ? Thanks.

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  

×