Jump to content
Sign in to follow this  

Close & Show GUI's

Recommended Posts


Basically when I click on settings in the tray menu, and the close button the the gui that opens, I want the gui to like close but the program not exit, and I don't really want to just "hide" the gui, thanks.

Current Code:

#cs ----------------------------------------------------------------------------

    AutoIt Version: (beta)
    Author:      Godly

    Script Function:
    Alt Tabs When Mouse In Defined Spot

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)

$iSettings = TrayCreateItem("Settings")
$iSep1 = TrayCreateItem("")
$iAbout = TrayCreateItem("About")
$iExit = TrayCreateItem("Exit")

TrayItemSetOnEvent($iSettings, "Settings")
TrayItemSetOnEvent($iAbout, "About")
TrayItemSetOnEvent($iExit, "End")

While 1

Func End()
EndFunc  ;==>End

Func Settings()
$frmSettings = GUICreate("Settings", 303, 201, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
$Group1 = GUICtrlCreateGroup("Main"a, 8, 0, 289, 193, -1, $WS_EX_TRANSPARENT)
$cbReload = GUICtrlCreateCheckbox("Reload On Save", 16, 24, 113, 17)
$Label1 = GUICtrlCreateLabel("X Location:", 16, 56, 58, 17)
$Label2 = GUICtrlCreateLabel("Y Location:", 16, 80, 58, 17)
$xLoc = GUICtrlCreateInput("0", 80, 54, 30, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$yLoc = GUICtrlCreateInput("0", 80, 78, 30, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
EndFunc  ;==>Settings

Func About()
    MsgBox(0, "bb", "bb")
EndFunc  ;==>About
Edited by Godly

Share this post

Link to post
Share on other sites


#include <GUIConstants.au3>

GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then GUISetState (@SW_HIDE)

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