Jump to content

Slow Comboboxes and GUISetState(@SW_DISABLE, $hGUI) still updates GUI


Blaxxun
 Share

Go to solution Solved by mikell,

Recommended Posts

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

@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 by Blaxxun
Link to comment
Share on other sites

@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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...