Jump to content

durden

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by durden

  1. Thanks for the responses, thats exactly what I needed! Edit: I'm assuming that the nested GuiGetMsg would have to wait for each iteration of the while loop before exiting the loop right? If this loop could potentially take 3-5 minutes to complete, the stop button wouldnt be very responsive I'm assuming. Is there any better way to do what I'm wanting to do? Inside the loop I'm needing to send keyboard commands, and then wait certain time periods and send new commands.
  2. Hi, I'm attempting to write a script that has a couple of buttons (start, stop) and a couple of edit fields. When the user clicks the start button, I need it to run some sort of loop until they click the stop button. My problem is that once that loop is started with the user hitting the start button, the main GUI loop cannot regain control because its obviously stuck in an endless loop. Whats the best way to handle this? Here is an example of the code: #include <GUIConstants.au3> GUICreate("Test", 300, 300) GUICtrlCreateLabel("Left Turn Time", 20, 10) $left = GUICtrlCreateEdit("", 20, 30, 150, 40) GUICtrlCreateLabel("Right Turn Time", 20, 90) $right = GUICtrlCreateEdit("", 20, 110, 150, 40) $startButton = GUICtrlCreateButton("Start", 20, 270, 60) $stopButton = GUICtrlCreateButton("Stop", 90, 270, 60) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $startButton MsgBox(0, "GUI Event", "You pressed start button!") While 1 ;... blah ... Sleep(Random(120000,240000)) WEnd Case $msg = $stopButton MsgBox(0, "GUI Event", "You pressed stop button!") Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") ExitLoop EndSelect WEnd
×
×
  • Create New...