I have an owner-drawn list control in my Windows program. I use CListCtrl::GetBkColor to get the background color, and for a selected item I use GetSysColor(COLOR_HIGHLIGHT). This matches what Windows uses for non owner drawn list controls, except for the case where the control doesn't have focus - then the background is replaced with gray.
Does Windows use one of the GetSysColor constants for the selected but unfocused background? If so, which one?
COLOR_INACTIVECAPTION
(3), I think.
Update: Nope, it looks like it's just COLOR_BTNFACE
(15).
Ah, ok. With a bit of fiddling, I've determined that it uses the SystemColors.Control
color in .Net, which is the equivalent of the C++ COLOR_3DFACE
COLOR_BTNFACE
, COLOR_MENU
, and COLOR_MENUBAR
all also represent the same color on a default install of Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With