Jump to content

Recommended Posts

Posted

Hi,

i would like to know if it's possible to hide the window in the start menu but keep it opened (like TeamSpeak does for exemple) and in the that case, how may i do it?

thanks in advance

Posted

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)

Posted

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
Posted

You can make it a $WS_EX_TOOLWINDOW, however, that will only prevent it from making a taskbar button... it won't hide one once it's been created i don't think...

Posted

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

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
×
×
  • Create New...