Although this is from the example program for GUIGetMsg(), and it works, it seems like there is a serious problem.
While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "", "Dialog was closed") Exit Case $msg = $GUI_EVENT_MINIMIZE MsgBox(0, "", "Dialog minimized", 2) Case $msg = $GUI_EVENT_MAXIMIZE MsgBox(0, "", "Dialog restored", 2) Case $msg = $button_1 MsgBox(0, "Default button clicked", "Radio " & $radioval1) Case $msg >= $radio_1 And $msg <= $radio_3 $radioval1 = $msg - $radio_1 EndSelect WEnd
If there is no GUI activity, the script is basically an infinite loop that runs with no delay.
Yet the task manager CPU usage does not jump to 100% when running the program. That seems... odd.
It seems like the program design should be more event driven, so that if nothing is happening the program will sleep. Though apparently there is no such thing as
Is this really the normal programming practice for Windows GUI event loops? It just seems wrong to be using an infinite loop with no idle-time release mechanism.
Edited by Javik, 06 March 2012 - 08:08 PM.




