Jump to content
Sign in to follow this  
BlackMore

Hide window in start menu

Recommended Posts

BlackMore

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

Share this post


Link to post
Share on other sites
JFee

What do you mean by hide it in the start menu?


Regards,Josh

Share this post


Link to post
Share on other sites
BlackMore

The tab that opens in the start menu once you open the script or any other program.

Share this post


Link to post
Share on other sites
JFee

You mean the task bar?


Regards,Josh

Share this post


Link to post
Share on other sites
BlackMore

yeah thats it my bad... sry i got a bit confused

Share this post


Link to post
Share on other sites
JFee

What happens if you give the window the $WS_CHILD style?


Regards,Josh

Share this post


Link to post
Share on other sites
BlackMore

The gui don't even show but the windows show aswell but i need the gui visible

Share this post


Link to post
Share on other sites
Paulie

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)

Share this post


Link to post
Share on other sites
BlackMore

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

Share this post


Link to post
Share on other sites
Paulie

Oops, forgot about the new include system

add this at the top of the script

#include <GuiConstantsEx.au3>

Share this post


Link to post
Share on other sites
BlackMore

It's almost that but what i need is when i choose hide the GUI keps active but hide in the task bar...

Share this post


Link to post
Share on other sites
Paulie

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

Share this post


Link to post
Share on other sites
BlackMore

$WS_EX_TOOLWINDOW removed the minimize, maximize and close buttons only the task bar button happered anyway

Share this post


Link to post
Share on other sites
Paulie

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

Share this post


Link to post
Share on other sites
BlackMore

Exactly!!! Thank you very much Paulie

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.