Musashi Posted December 2, 2023 Share Posted December 2, 2023 (edited) 1 hour ago, AutoDEV said: Please can you tell me how to continue and not stay in loop while ? For whow show a MsgBox I still don't realize what you want to achieve with this script. To exit a loop like While, a termination condition is required. This is currently not the case and therefore the script runs forever. I have activated the exit button, but I am almost certain that this will not solve your actual problem. $choice = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idYess = GUICtrlCreateButton("YES", 10, 50, 65, 25) Local $idNoo = GUICtrlCreateButton("NON", 80, 50, 65, 25) Local $idExitt = GUICtrlCreateButton("EXIT", 150, 50, 65, 25) GUISetState(@SW_SHOW, $choice) ;While can must run in background While 1 Switch GUIGetMsg() Case $idYess ConsoleWrite("$idYess=" & $idYess & @CRLF) ;ExitLoop Case $idNoo ConsoleWrite("$idNoo=" & $idNoo & @CRLF) Case $idExitt ConsoleWrite("$idExitt=" & $idExitt & @CRLF) ExitLoop EndSwitch WEnd MsgBox(0, '', "I want show this msgbox") EDIT : @Melba23 was a little faster Edited December 2, 2023 by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
AutoDEV Posted December 2, 2023 Author Share Posted December 2, 2023 (edited) THX. I have one problem with your script; When i click is ok i can show mw modal. But after GUI is disable and any button work I need a GUI Can you helo me plz ? Edited December 2, 2023 by AutoDEV Link to comment Share on other sites More sharing options...
Musashi Posted December 2, 2023 Share Posted December 2, 2023 13 minutes ago, AutoDEV said: When i click is ok i can show mw modal. But after GUI is disable anydes button work I need a GUI Can you helo me plz ? I rarely say this, but your posts are getting increasingly ridiculous. Since English is obviously not your native language, show at least some effort and use a translation software. A reasonably clear description of your problem would also be helpful. I, and probably others as well, have not the faintest clue what you want to achieve. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
AutoDEV Posted December 2, 2023 Author Share Posted December 2, 2023 Thx, sorry if u not understand. Exemple i have this : expandcollapse popupGlobal $test $choice = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idYess = GUICtrlCreateButton("YES", 10, 50, 65, 25) Local $idNoo = GUICtrlCreateButton("NON", 80, 50, 65, 25) Local $idExitt = GUICtrlCreateButton("EXIT", 150, 50, 65, 25) GUISetState(@SW_SHOW, $choice) Local $iMsgBoxAnswer = 1, $bLoop = True While $bLoop Switch GUIGetMsg() Case $idYess ConsoleWrite("$idYess=" & $idYess & @CRLF) Case $idNoo ConsoleWrite("$idNoo=" & $idNoo & @CRLF) EndSwitch If $iMsgBoxAnswer = 1 Then ContinueLoop $iMsgBoxAnswer = MsgBox(4100, "MsgBox", "Are you sure you want to close the program?", 3) Select Case $iMsgBoxAnswer = 6 ;Yes ConsoleWrite("- bye bye" & @CRLF) $bLoop = False EndSelect WEnd Global $num = 1 While 1 Switch $num Case "1" MsgBox(0, '', 'Number 1') ExitLoop EndSwitch Wend How to check my while 2 and cointinue run un background my frirst while. Idk if is posible but it's what i need. Ty Link to comment Share on other sites More sharing options...
AutoDEV Posted December 3, 2023 Author Share Posted December 3, 2023 Is 19 hours ago, Musashi said: I still don't realize what you want to achieve with this script. To exit a loop like While, a termination condition is required. This is currently not the case and therefore the script runs forever. I have activated the exit button, but I am almost certain that this will not solve your actual problem. $choice = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idYess = GUICtrlCreateButton("YES", 10, 50, 65, 25) Local $idNoo = GUICtrlCreateButton("NON", 80, 50, 65, 25) Local $idExitt = GUICtrlCreateButton("EXIT", 150, 50, 65, 25) GUISetState(@SW_SHOW, $choice) ;While can must run in background While 1 Switch GUIGetMsg() Case $idYess ConsoleWrite("$idYess=" & $idYess & @CRLF) ;ExitLoop Case $idNoo ConsoleWrite("$idNoo=" & $idNoo & @CRLF) Case $idExitt ConsoleWrite("$idExitt=" & $idExitt & @CRLF) ExitLoop EndSwitch WEnd MsgBox(0, '', "I want show this msgbox") EDIT : @Melba23 was a little faster OK, i need one gui for pause or exit a task who i making in my script. GUI maust be always show. And if i click on button i want stop or pause a script. I can't say more. If u not understand i can add a more description Thank Link to comment Share on other sites More sharing options...
AutoDEV Posted December 5, 2023 Author Share Posted December 5, 2023 (edited) Please i very need help. Exemple : $choice = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idYess = GUICtrlCreateButton("YES", 10, 50, 65, 25) GUISetState(@SW_SHOW, $choice) ;GUI MUST BE ALWAS ON $num = 1 while 1 Switch $num case 1 MsgBox(0, '', $num) ExitLoop EndSwitch While 1 Switch GUIGetMsg() Case $idYess ConsoleWrite("$idYess=" & $idYess & @CRLF) ;ExitLoop EndSwitch WEnd Wend Please how to get on last while a statu of button who i have clicked ? (YES) Edited December 5, 2023 by AutoDEV Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 5, 2023 Moderators Share Posted December 5, 2023 AutoDEV, I think I am safe in saying that no-one here has the slightest idea of what you are trying to do with this script - which rather limits us in the help we can offer you. I suggest you write down in your native language clearly and in some detail what it is you are trying to achieve and post both that AND a translated version - that way there is a chance that we might be able to work out a solution for you. M23 Musashi 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AutoDEV Posted January 8 Author Share Posted January 8 (edited) Hellow Im come back with a same problem Your code work but if i not click on Quote MsgBox(0, '', "I want show this msgbox") My next code not working. I have show this : #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Local $idMsg, $iMenustate, $sMenutext Do $idMsg = GUIGetMsg() If $idMsg = $idButton Then MsgBox($MB_SYSTEMMODAL, "Selected listbox entry", GUICtrlRead($idList)) $iMenustate = GUICtrlRead($idMenu1) $sMenutext = GUICtrlRead($idMenu1, 1) MsgBox($MB_SYSTEMMODAL, "State and text of the menuitem", "state:" & $iMenustate & @CRLF & "text:" & $sMenutext) EndIf Until $idMsg = $GUI_EVENT_CLOSE But for continue code and waiting action on my gui how to make please . Edited January 8 by AutoDEV 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