Jump to content

Ho to hide/show GUI window from tray?


Recommended Posts

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?

Link to comment
Share on other sites

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

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...