Sign in to follow this  
Followers 0
skiffle

click twice ore more to exit programm

2 posts in this topic

Hallo.

After a GUIDelete and relaunch of the same GUI I have to click as many times as the GUI was restarted on the red close button to close the programm even when there is just one instanz open..

Why this happens?

Please see my little script and thanks for any idea.

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <Array.au3>

new()

Func new()

$Form1 = GUICreate("IT-starts", 334, 200, 544, 120)

GUISetIcon("")

$btn = GUICtrlCreateButton("Ok", 40, 30, 60, 20)

GUISetState(@SW_SHOW)

While 1

$msg2 = GUIGetMsg()

Select

Case $msg2 = $GUI_EVENT_CLOSE

ExitLoop

Case $msg2 = $btn

GUIDelete($Form1)

new()

EndSelect

WEnd

EndFunc

Share this post


Link to post
Share on other sites



#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
new()
Func new()
$Form1 = GUICreate("IT-starts", 334, 200, 544, 120)
GUISetIcon("")
$btn = GUICtrlCreateButton("Ok", 40, 30, 60, 20)

GUISetState(@SW_SHOW)
While 1
$msg2 = GUIGetMsg()
If $msg2 = $GUI_EVENT_CLOSE Then Exit
Select
;Case $msg2 = $GUI_EVENT_CLOSE
;ExitLoop
Case $msg2 = $btn
GUIDelete($Form1)
new()

EndSelect
WEnd
EndFunc
Is this what you want to achieve?


[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

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