Zane Posted January 30, 2010 Share Posted January 30, 2010 is there a way to do a loop in second plane without affecting the buttons? for example: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 172, 53, 313, 377) $Start = GUICtrlCreateButton("Start", 8, 16, 75, 25, $WS_GROUP) $Stop = GUICtrlCreateButton("Stop", 88, 16, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start $A = "0" Do RegWrite ("HKEY_CURRENT_USER\Software\MyApplication", "testkey", "REG_SZ", "im a value") Until $A = "1" Case $Stop Exit EndSwitch WEnd why i cant use the stop button , please giveme a solution Link to comment Share on other sites More sharing options...
ChaosCookie Posted January 30, 2010 Share Posted January 30, 2010 (edited) because your start-case is an infinite loop... what do you want to do with the var "A"? If its meant to be some kind of iterator do it like this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 172, 53, 313, 377) $Start = GUICtrlCreateButton("Start", 8, 16, 75, 25, $WS_GROUP) $Stop = GUICtrlCreateButton("Stop", 88, 16, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start $A = 0 Do $A += 1 RegWrite ("HKEY_CURRENT_USER\Software\MyApplication", "testkey", "REG_SZ", "im a value") Until $A = 1 Case $Stop Exit EndSwitch WEnd ah and no you cant run 2 loops at the same time... but you can can manage them to run after each other with Adlib/_Adlib! Edited January 30, 2010 by ChaosCookie Link to comment Share on other sites More sharing options...
Zedna Posted January 30, 2010 Share Posted January 30, 2010 (edited) Look here at princip how to react on GUI events inside nested loops (call GUIGetMsg())#766558 Edited January 30, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zane Posted January 30, 2010 Author Share Posted January 30, 2010 (edited) ah and no you cant run 2 loops at the same time... but you can can manage them to run after each other with Adlib/_Adlib! tank you , just was i needed #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 172, 53, 313, 377) $Start = GUICtrlCreateButton("Start", 8, 16, 75, 25, $WS_GROUP) $Stop = GUICtrlCreateButton("Stop", 88, 16, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start AdlibRegister ("Test1") Case $Stop AdlibUnRegister ("Test1") Exit EndSwitch WEnd Func Test1() RegWrite ("HKEY_CURRENT_USER\Software\MyApplication", "testkey", "REG_SZ", "im a value") EndFunc Edited January 30, 2010 by Zane Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now