Sign in to follow this  
Followers 0
BlackMore

Hide window in start menu

15 posts in this topic

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



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


Regards,Josh

Share this post


Link to post
Share on other sites

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

You mean the task bar?


Regards,Josh

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


Regards,Josh

Share this post


Link to post
Share on other sites

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

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

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

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

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

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

$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

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

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  
Followers 0