AlienStar Posted January 1, 2021 Share Posted January 1, 2021 hello everybody after I disable a GUI I need to be able to minimize GUISetState(@SW_DISABLE, $hGUI) how to do please ? Link to comment Share on other sites More sharing options...
TheXman Posted January 2, 2021 Share Posted January 2, 2021 Is this some sort of trick question? What happens when you use @SW_MINIMIZE? CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
AlienStar Posted January 2, 2021 Author Share Posted January 2, 2021 (edited) 16 hours ago, TheXman said: Is this some sort of trick question? What happens when you use @SW_MINIMIZE? there are operations with a progress bar in my script and they take a while to finish. and I need to disable the GUI to prevent re-click on the buttons so until the operation finishes I may need to minimize the script to do something else . here is an example explain more expandcollapse popup#include <GUIConstantsEx.au3> #include <Array.au3> ; Create a GUI with various controls. Local $hGUI = GUICreate("Test") Local $idsubmit = GUICtrlCreateButton("Submit", 20, 50, 85, 25) Local $idfltr = GUICtrlCreateButton("Filter", 20, 100, 85, 25) Local $iddel = GUICtrlCreateButton("Delete", 20, 150, 85, 25) Local $array[10] ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;======================= Case $idsubmit GUISetState(@SW_DISABLE, $hGUI) $size = UBound($array) - 1 ProgressOn("Progress", "in pending", "0%", -1, -1) For $i = 0 To $size ;------------- $ip = (100 / UBound($array)) * $i ProgressSet($ip, Round($ip, 0) & "% - " & $i & "/" & UBound($array)) ;------------- $array[$i] = $i + 2 * $i Sleep(500) Next ;------------- ProgressOff() _ArrayDisplay($array) GUISetState(@SW_ENABLE, $hGUI) ;======================= EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) Edited January 2, 2021 by AlienStar Link to comment Share on other sites More sharing options...
Nine Posted January 2, 2021 Share Posted January 2, 2021 (edited) Maybe this ? expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> ; Create a GUI with various controls. Local $hGUI = GUICreate("Test") Local $idsubmit = GUICtrlCreateButton("Submit", 20, 50, 85, 25) Local $idfltr = GUICtrlCreateButton("Filter", 20, 100, 85, 25) Local $iddel = GUICtrlCreateButton("Delete", 20, 150, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;======================= Case $idsubmit GUISetState(@SW_MINIMIZE, $hGUI) GUISetState(@SW_DISABLE, $hGUI) ShowProgress() GUISetState(@SW_ENABLE, $hGUI) GUISetState(@SW_RESTORE, $hGUI) ;======================= EndSwitch WEnd Func ShowProgress() Local $array[10] Local $size = UBound($array) - 1 ProgressOn("Progress", "in pending", "0%", -1, -1, $DLG_MOVEABLE) For $i = 0 To $size $ip = (100 / UBound($array)) * $i ProgressSet($ip, Round($ip, 0) & "% - " & $i & "/" & UBound($array)) $array[$i] = $i + 2 * $i Sleep(500) Next ProgressOff() _ArrayDisplay($array) EndFunc ;==>ShowProgress Edited January 2, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AlienStar Posted January 2, 2021 Author Share Posted January 2, 2021 3 minutes ago, Nine said: Maybe this ? expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> ; Create a GUI with various controls. Local $hGUI = GUICreate("Test") Local $idsubmit = GUICtrlCreateButton("Submit", 20, 50, 85, 25) Local $idfltr = GUICtrlCreateButton("Filter", 20, 100, 85, 25) Local $iddel = GUICtrlCreateButton("Delete", 20, 150, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;======================= Case $idsubmit GUISetState(@SW_MINIMIZE, $hGUI) GUISetState(@SW_DISABLE, $hGUI) ShowProgress() GUISetState(@SW_ENABLE, $hGUI) GUISetState(@SW_RESTORE, $hGUI) ;======================= EndSwitch WEnd Func ShowProgress() Local $array[10] Local $size = UBound($array) - 1 GUISetState() ProgressOn("Progress", "in pending", "0%", -1, -1, $DLG_MOVEABLE) For $i = 0 To $size $ip = (100 / UBound($array)) * $i ProgressSet($ip, Round($ip, 0) & "% - " & $i & "/" & UBound($array)) $array[$i] = $i + 2 * $i Sleep(500) Next ProgressOff() _ArrayDisplay($array) EndFunc ;==>ShowProgress thanks my friend but I don't wanna minimize at first because maybe I don't need to do. all what I need is the ability to minimize (or move) gui after disabling Link to comment Share on other sites More sharing options...
Nine Posted January 2, 2021 Share Posted January 2, 2021 Instead of disabling the whole GUI, why don't you simply disable the controls that you do not want the user to press while in progress. That would solve your issue. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AlienStar Posted January 2, 2021 Author Share Posted January 2, 2021 5 minutes ago, Nine said: Instead of disabling the whole GUI, why don't you simply disable the controls that you do not want the user to press while in progress. That would solve your issue. This idea crossed my mind but I have about 20 controls so I need to make a loop to disable them then enable each time That's why I've asked this question if I don't reach an answer I'll make that loop thanks my friend Link to comment Share on other sites More sharing options...
Nine Posted January 2, 2021 Share Posted January 2, 2021 It is easier to make that loop than trying to simulate a border click to minimize the GUI. Just create a Func and pass the state (@SW_ENABLE/@SW_DISABLE) as a parameter. AlienStar 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AlienStar Posted January 2, 2021 Author Share Posted January 2, 2021 OK thanks my friend 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