Sign in to follow this  
Followers 0
Noobster24

Onclick or ondoubleclick on tray icon -> show GUI

3 posts in this topic

#1 ·  Posted (edited)

Hi,

I searched the forum for tray maximize click, but I couldn't find my answer there.

Is there a(n easy) way to maximize your GUI when you click or double click the TrayIcon?

I know the @SW_SHOW etc. commands, but I can't find the command I need in the help-file.

Any ideas?

Thanks,

Andreas

//Edit ah stupid me, found it:

GUICtrlSetOnEvent($TRAY_EVENT_PRIMARYDOWN, "OKButton")

Edited by Noobster24

Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc.

Share this post


Link to post
Share on other sites



Hi,

I searched the forum for tray maximize click, but I couldn't find my answer there.

Is there a(n easy) way to maximize your GUI when you click or double click the TrayIcon?

I know the @SW_SHOW etc. commands, but I can't find the command I need in the help-file.

Any ideas?

Thanks,

Andreas

//Edit ah stupid me, found it:

GUICtrlSetOnEvent($TRAY_EVENT_PRIMARYDOWN, "OKButton")

Maybe this will help

#include <GuiConstants.au3>


$gg = GUICreate("sample 1")
GUISetState()

Opt("TrayAutoPause",0); Script will not be paused when clicking the tray icon.
$zal   = TrayCreateItem("Maximise")
TrayCreateItem("")
TraySetState()


While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

    $tsg = TrayGetMsg()
    Switch $tsg
        Case $zal
            GUISetState(@SW_RESTORE,WinGetHandle("sample"))
            
    EndSwitch
WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Maybe this will help

#include <GuiConstants.au3>
$gg = GUICreate("sample 1")
GUISetState()

Opt("TrayAutoPause",0); Script will not be paused when clicking the tray icon.
$zal   = TrayCreateItem("Maximise")
TrayCreateItem("")
TraySetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

    $tsg = TrayGetMsg()
    Switch $tsg
        Case $zal
            GUISetState(@SW_RESTORE,WinGetHandle("sample"))
            
    EndSwitch
WEnd
Thanks, but I found this function in the helpfile:

TraySetOnEvent ( specialID, "function" )

Works great for me!


Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc.

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