Jump to content

Window close after few seconds


Termite
 Share

Recommended Posts

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

Link to comment
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:


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

Link to comment
Share on other sites

  • Developers

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....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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 ...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...