End Google Ads 201810 - BS.net 01 --> Hi All,

I'm tearing my hear out over this one. I am subclassing controls dynamically at runtime. I run through each child control of a window, and check it's class. If the class is "BUTTON" I want to subclass it to one of four controls:

CThemedButton : public CButton
CThemedRadioButton : public CButton
CThemedGroupBox : public CButton
CThemedCheckBox : public CButton

However, I cannot for the life of me get the correct combination of window styles to make this work in every case. My code is as below:

bool bGroupBox = (dwControlStyle&BS_GROUPBOX);
bool bRadioButton = (dwControlStyle&BS_RADIOBUTTON);
bool bAutoRadioButton = (dwControlStyle&BS_AUTORADIOBUTTON);
bool bCheckBox = (dwControlStyle&BS_CHECKBOX);
bool bAutoCheckBox = (dwControlStyle&BS_AUTOCHECKBOX);
bool bPushLike = (dwControlStyle&BS_PUSHLIKE);

But I'm getting bizarre results. It seems that BS_AUTORADIOBUTTON for example is a combination of other flags, as is BS_GROUPBOX. The end result is I get some buttons that are subclassed, unless they're the default buttons, group boxes aren't picked up, check boxes are missed. The button styles aren't proper flags it seems, so I'm getting cases where bRadioButton, bAutoRadioButton and bGroupBox are all true!

Please can anyone help me here? This should be simple but it's been causing me no end of problems.

Thanks in advance,

Dave Kerr