Jump to content

Onclick or ondoubleclick on tray icon -> show GUI


Recommended Posts

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