Recently Browsing 0 members
No registered users viewing this page.
I'm trying to make it so that when a message box pops up that the GUI will be unresponsive until that message box has been closed. From reading through the help the closest thing I can find is the WinWaitClose function, however this doesn't work fully as desired. If user tries to click on GUI the actions are more just waiting for the message box to close, so that once it closes everything happens at once. I want it so that the GUI is completely unusable until message box is closed.
Below is test code to demonstrate the problem and help explain what I want. Any advice on this?
#include <GUIConstantsEx.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example") Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) local $but = GUICtrlCreateButton("Hello", 150,150,85,25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox( 262144,"Message","Try hitting the hello button several times,without closing this window. Now close this window and see how script wasn't restricted it just was waiting and storing the instructions") WinWaitClose("Message") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK Exit case $but MsgBox(0,"","Hello") EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example
I am looking for a quick tip on why my autoit script crashes when I run a timer. Currently I have this code:
....(more code above this)....
_Timer_setTimer($hGUI, 3200, "_timedout")
Msgbox(0, "Timed out", "Time is up!")
When the button is pressed, my timer starts, correct? It doesnt seem to matter if I have it on button activation or not, after the time goes by for a bit, it crashes.
Seemingly when the time is up, my script crashes.
Thanks for your help!