I'm trying to draw a custom control that should use the "combobox" theme class.
Using
m_hTheme = OpenThemeData(m_hWnd, _T("COMBOBOX"));
auto stateBG = ...; DrawThemeBackground(m_hTheme, ps.hdc, CP_READONLY, stateBG, &clientRect, nullptr);
gives the correct background (read-only-look) without the chevron. But how do I add the chevron?
auto stateCV = ...; DrawThemeBackground(m_hTheme, ps.hdc, CP_DROPDOWNBUTTON, stateCV, &rect, nullptr);
draws the chevron correctly, but with its own border and the chevron centered within the `rect`. So if I use the full client rect, I get this:
combobox centered chevron[
^]
If I use a smaller rect so that the chevron is positioned correctly, I get a separated dropdown:
combobox boxed chevron[
^]
How do I get the "normal" look? - i.e like this:
How it should look[
^]
Is there any documentation that does a better job than MSDN? It's as sparse as most newer documentation, e.g. just listing "Parts and States", without describing their purpose (which is not always obvious), and whether it's `DrawThemeBackground` or ~`Edge`for a particular item.
Bonus Question: Do I still use the good old `DrawFocusRect`for the focus rect?
What I have tried:
(see above. I've tried a lot. like really a lot. 30 chatracters you say?)