Sign in to follow this  
Followers 0
Termite

Window close after few seconds

9 posts in this topic

First:

Sorry for my bad english!!!!

I'm a Newbie.

I want to create a window. After a few seconds the window closse automatically.

I have read the helpfiles and follows the instructions. But my Problem still alive :-( .

Please help me to fix my Prob. I've copy a script example from this forum like this:

#include<GUIConstants.au3>

Dim $i = 0, $t = 0, $dif, $begin

GUICreate("Hello World!!", 250, 120)

GUICtrlCreateLabel("Time Count:", 55, 35)

$time = GUICtrlCreateLabel(" ", 125, 35)

$okbutton = GUICtrlCreateButton("OK", 60, 70, 60)

$stopbutton = GUICtrlCreateButton("STOP", 130, 70, 60)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $okbutton

$t = 1

$i = 0

$begin = TimerInit()

Case $msg = $stopbutton

$t = 0

Case $msg = $GUI_EVENT_CLOSE

EndSelect

$dif = TimerDiff($begin)

If $t = 1 And $dif >= 1000 Then

$i = $i + 1

GUICtrlSetData($time, $i)

$begin = TimerInit()

EndIf

WEnd

The window closed automatically, befor the script has reaches the end. I tried many other script with

the same result.

PLEASE Help Me

Greetz the Termite

Share this post


Link to post
Share on other sites



I am confused. Do you want the window to close after a few seconds or is it closing after a few seconds on its own.

I have run your script until the counter went over the 100 and it showed no signs of stopping on its own. The only problem I seen was that the label was not big enough to let you see more than 2 digits.

BTW - Welcome to the best forum on the net. :lmao:



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

The script sis stopping on its own, after 2 or 5 seconds.

After the script ends, there is no error message.

Thx for the fast help.

Share this post


Link to post
Share on other sites

The script sis stopping on its own, after 2 or 5 seconds.

After the script ends, there is no error message.

Thx for the fast help.

How are you running the script ? (from SciTE or something else ?)

The script will only exit when the window is closed so there is either something that pushed the close window button or the script runs into an error....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What ist SciTE?

I have copy the script from this Froum in AutoED. After I have paste it in the editor, i pressed F9

to run the script.

Share this post


Link to post
Share on other sites

What ist SciTE?

SciTE4AutoIt3

I have copy the script from this Froum in AutoED. After I have paste it in the editor, i pressed F9

to run the script.

Try running it from the Windows Explorer by doing a right mouse click and select Run Script ...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thx for your help.

After i have compile the script, it runs perfectly.

Thx for the fast help, this is a great community!!!

Share this post


Link to post
Share on other sites

Thx for your help.

After i have compile the script, it runs perfectly.

Thx for the fast help, this is a great community!!!

yes thats true its a great community :lmao:

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