Blaxxun Posted December 25, 2023 Share Posted December 25, 2023 Hello forum! Merry Christmas! I have this little loop here and I want to stop the GUI update until the comboboxes are populated. I want to do this because it takes around 3 seconds to draw 10 comboboxes. They all hold the same $sText (1200 items). But for some reason i can still see how they get created. ; Comboboxes create _______________________________________________________________________________________________________________ GUISetState(@SW_DISABLE, $hGUI) For $i = 1 To $iCoCo $hCombo[$i - 1] = _GUICtrlComboBox_Create($hGUI, $sKeys, $aPosX[$i], 37, $aColWI[$i] - 1, 500, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) $iCombo[$i - 1] = _WinAPI_GetDlgCtrlID($hCombo[$i - 1]) Next GUISetState(@SW_ENABLE, $hGUI) Thanks!! Link to comment Share on other sites More sharing options...
Danp2 Posted December 25, 2023 Share Posted December 25, 2023 Have you tried using @SW_LOCK / @SW_UNLOCK instead of @SW_DISABLE / @SW_ENABLE? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Blaxxun Posted December 26, 2023 Author Share Posted December 26, 2023 (edited) @Danp2 Yes, this stops the GUI from updating. Thanks for that. Unfortunately, it does not speed up the creation of the comboboxes. I thought if I provided a delimited string @ creation, it would generate faster than when I use _GUICtrlComboBox_AddString one by one. Turns out they are both the same slow speed. Edited December 26, 2023 by Blaxxun Link to comment Share on other sites More sharing options...
Danp2 Posted December 26, 2023 Share Posted December 26, 2023 Using a delimited string won't improve the speed because internally it just splits the string and performs the _GUICtrlComboBox_AddString in a loop. You may want to take a look at _GUICtrlComboBox_InitStorage. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Solution mikell Posted December 27, 2023 Solution Share Posted December 27, 2023 On 12/25/2023 at 11:49 PM, Blaxxun said: I want to stop the GUI update until the comboboxes are populated It seems that you need this : _GUICtrlComboBox_BeginUpdate Musashi 1 Link to comment Share on other sites More sharing options...
Blaxxun Posted December 27, 2023 Author Share Posted December 27, 2023 @Danp2 Hello, and thanks for the tip. Unfortunately _GUICtrlComboBox_InitStorage did not speedup the process. @mikell Hello, thanks a lot. I could swear that I tested this with beginupdate / endupdate and it did not make a difference. BUT now with _GUICtrlComboBox_BeginUpdate it shaved off 1.5 seconds of 2.8 seconds. Great, thank you guys! 👍 Link to comment Share on other sites More sharing options...
Nine Posted December 27, 2023 Share Posted December 27, 2023 @Blaxxun You should consider giving solution to mikell instead of yourself...if you understand what I mean. mikell and Musashi 2 “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...
Blaxxun Posted December 30, 2023 Author Share Posted December 30, 2023 @Nine You are absolutely right! Link to comment Share on other sites More sharing options...
Blaxxun Posted December 30, 2023 Author Share Posted December 30, 2023 I was able to shave off a little more time by using the DLL call directly. ; Comboboxen Dropdown List fill _______________________________________________________________________________________________________________ Local $iLen = UBound($aINI_KeyList) Local $hDll = DllOpen("user32.dll") For $x = 0 To UBound($hCombo) - 1 _GUICtrlComboBox_BeginUpdate($hCombo[$x]) For $i = 0 To $iLen - 1 ; INI Keys durchgehen ; _GUICtrlComboBox_AddString = _SendMessage DllCall($hDll, "lresult", "SendMessageW", "hwnd", $hCombo[$x], "uint", 0x143, "wparam", 0, "wstr", $aINI_KeyList[$i]) ; = _SendMessage Next _GUICtrlComboBox_EndUpdate($hCombo[$x]) Next DllClose($hDll) 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