Jump to content

Hide window in start menu


Recommended Posts

Is this what you were after?

A proof of concept:

#include <WindowsConstants.au3>
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)

$GUI = GuiCreate("Test", 200,100)
$Menu = TrayCreateMenu("Display")
$Hide = TrayCreateItem("Hide", $menu)
$Show = TrayCreateItem("Show", $menu)
$Exit = TrayCreateItem("Exit")
GUISetState()

While 1
    $gMsg=GUIGetMsg()
    $tMsg=TrayGetMsg()
    Switch $gmsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MINIMIZE
            WinSetState($GUI,"",@SW_HIDE)
    EndSwitch
    Switch $tmsg
        Case $Hide
            WinSetState($GUI,"",@SW_HIDE)
        Case $Show
            WinSetState($GUI,"",@SW_Show)
            WinSetState($GUI,"",@SW_RESTORE)
        Case $Exit
            Exit
    EndSwitch
WEnd

(Check out the Tray Icon)

Link to comment
Share on other sites

Is this what you were after?

A proof of concept:

#include <WindowsConstants.au3>
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)

$GUI = GuiCreate("Test", 200,100)
$Menu = TrayCreateMenu("Display")
$Hide = TrayCreateItem("Hide", $menu)
$Show = TrayCreateItem("Show", $menu)
$Exit = TrayCreateItem("Exit")
GUISetState()

While 1
    $gMsg=GUIGetMsg()
    $tMsg=TrayGetMsg()
    Switch $gmsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MINIMIZE
            WinSetState($GUI,"",@SW_HIDE)
    EndSwitch
    Switch $tmsg
        Case $Hide
            WinSetState($GUI,"",@SW_HIDE)
        Case $Show
            WinSetState($GUI,"",@SW_Show)
            WinSetState($GUI,"",@SW_RESTORE)
        Case $Exit
            Exit
    EndSwitch
WEnd

(Check out the Tray Icon)

that gives me error at line 16 and 18 :s
Link to comment
Share on other sites

I meant like this. No Taskbar here.

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)

$GUI = GuiCreate("Test", 200,100)
 GUISetStyle(-1, $WS_EX_TOOLWINDOW)
$Menu = TrayCreateMenu("Display")
$Hide = TrayCreateItem("Hide", $menu)
$Show = TrayCreateItem("Show", $menu)
$Exit = TrayCreateItem("Exit")
GUISetState()

While 1
    $gMsg=GUIGetMsg()
    $tMsg=TrayGetMsg()
    Switch $gmsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MINIMIZE
            WinSetState($GUI,"",@SW_HIDE)
    EndSwitch
    Switch $tmsg
        Case $Hide
            WinSetState($GUI,"",@SW_HIDE)
        Case $Show
            WinSetState($GUI,"",@SW_Show)
            WinSetState($GUI,"",@SW_RESTORE)
        Case $Exit
            Exit
    EndSwitch
WEnd
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...