On Freitag, 14. September 2018 14:14:07 CEST Nikolay Sivov wrote:
What is the issue exactly?
As the tests show, a listbox with WS_VSCROLL and height 0 has the WS_VSCROLL style set after window creation.
However, when LISTBOX_UpdateScroll is called, this hides the scrollbar (removing the WS_VSCROLL style) - since it's not needed when the listbox is empty.
Now, CreateWindowEx sends WM_SIZE with SIZE_RESTORED, this triggers LISTBOX_UpdateSize which then calls LISTBOX_UpdateScroll. CreateWindowEx also sends WM_SETFONT which will trigger a resize - leading to the same issue.
But as the tests also show, this is only relevant during CreateWindowEx. When with listbox empty and height 0, causing a WM_SIZE due to SetWindowPos causes the scrollbar to be hidden.
I didn't find a better solution yet, since it indeed seems to only be problematic during initial window creation.
FWIW, the issue is themed delphi programs, their comboboxes are *very* sensitive about listbox height/WS_VSCROLL style when WM_NCCALCSIZE is sent.
Regards, Fabian Maurer