Sign in to follow this  
Followers 0
babyjoe

Maximize a process running from systray

8 posts in this topic

Hello,

I want to maximize a program running in systray (Messenger). I already have code to see if it's running, and get it's PID. But I can not get it from systray to screen. WinActive and WinSetState do not achieve anything.

I couldn't find similar problem with the search function.

Please help.

Share this post


Link to post
Share on other sites



Hi,

what messanger? What is the manual way of restoring it? Did you look at systray udf?

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

Windows Live Messenger.

The only way to get it fom systray is rightclick it, and order it to open (it keeps connected while minimized).

I have seen systray udf, but it is much too complicated for me, I can not sort out the functionality I need.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi,

surely there are easier ways, but maybe this gets you started:

#include<Systray.au3>

Global $title = "141-677-093"

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)
            ExitLoop
        EndIf
    Next
    MouseMove($p[0], $p[1], 1)
EndFunc   ;==>clickSysTray

To get the title use Autoit Window Info.exe

So long,

Mega

Edited by th.meger

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

It seems that I do not have 'systray.au3', I can not find it on the website either?

Share this post


Link to post
Share on other sites

It seems that I do not have 'systray.au3', I can not find it on the website either?

Hi,

yes http://www.autoitscript.com/forum/index.php?showtopic=13704

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

This is the output of the systraylist function:

Connections Tray

Connections Tray

Connections Tray

Connections Tray

Connections Tray

ZoneAlarm Pro

Norton AntiVirus

Creative Volume Control

Icons I have: 1.Msn live messenger 2. network 3.zonealarm 4.Norton 5.sound 6.clock

I don't know what TrayConnections is. As you see, Messenger does not appear. When I use the WindowInfo tool, all programs have a title, except Messenger, it is empty (while in tray), but it has a class 'MSNHiddenWindowClass'. The only thing I know is its PID.

What is the next step?

Seems a tough one this.

Share this post


Link to post
Share on other sites

Hi,

try this.

#include<Systray.au3>

Global $title = "XXX"
Global $prcoess = "icqlite.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   ;==>clickSysTray

Func clickSysTrayByProcess($winProcess, $click = "left", $times = 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   ;==>clickSysTray

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

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