Jump to content
Sign in to follow this  
EmptySpace

Ho to hide/show GUI window from tray?

Recommended Posts

EmptySpace

How to explain... I want to make GUI to be able to be visible and not visible. Not visible it would be like $oIE = _IECreate("www.google.lt,0,0) <--- these 0 makes it not visible. And it would be controled from tray like making

TrayCreateMenu("Settings")

TrayCreateItem("Display")

TrayCreateItem("Show")

So how I could make it? I should make something with GUISetState?

Share this post


Link to post
Share on other sites
EmptySpace

Ok, GUISetState works. But now other question how to make it to switch after clicking on tray? For example gui is visible and you click directly on tray and then gui hides after clicking second time it shows again?

Share this post


Link to post
Share on other sites
stormbreaker

Something like this:

;Originally written by Zedna
#NoTrayIcon
#include <GuiConstants.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)  
TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"Event")
GuiCreate("MKISH's Example", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GuiSetState()
While 1
    $msg = GuiGetMsg()
   
    Select
        Case $msg = $GUI_EVENT_MINIMIZE
            GuiSetState(@SW_HIDE)
            TraySetState(1)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
Func Event()
    GuiSetState(@SW_Show)
    TraySetState(2)
EndFunc

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites
EmptySpace

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  

×