Jump to content
Sign in to follow this  
dufran3

Closing GUI

Recommended Posts

dufran3

GUI window stays open until script ends, however I want to close it just before the end of the script, so a pop up box will display saying it is complete.

$gMain = GUICreate('Star Splash',500,100,-1,-1,$WS_POPUP,$WS_EX_TOPMOST)

doing all my stuff....while the gui is displayed, all the actions are being performed in the background hidden...then

WinClose('Star Splash')
GUICtrlSetState($gmain,$GUI_HIDE)

FileWriteLine($FileOpen, 'Script Finished ' & @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF)
FileClose($FileOpen)

 MsgBox(0,'','Upgrade is Complete')

Neither the winclose of guisetstate close or hides the window

Share this post


Link to post
Share on other sites
Valuater

replace

GUICtrlSetState($gmain,$GUI_HIDE) ; for controls only

with

GUISetState( @SW_HIDE, $gmain)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
dufran3

ahhh, I see that. I replaced and it is still not closing.

Share this post


Link to post
Share on other sites
Valuater

works for me

#include <GUIConstants.au3>

$gMain = GUICreate('Star Splash',500,100,-1,-1,$WS_POPUP,$WS_EX_TOPMOST)
GUISetState()

;doing all my stuff....while the gui is displayed, all the actions are being performed in the background hidden...then

Sleep(1000)

;CODE
;WinClose('Star Splash')
GUISetState(@SW_HIDE, $gMain )
Sleep(1000)
;FileWriteLine($FileOpen, 'Script Finished ' & @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF)
;FileClose($FileOpen)

MsgBox(0,'','Upgrade is Complete')

mostly as you posted

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Rick

why not GuiDelete() ??


Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites
dufran3

Adding the Sleep(1000) after it fixed it

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  

×