- COLORREF colFg = wxColourToRGB(GetForegroundColour());
- if ( state & ODS_DISABLED ) colFg = GetSysColor(COLOR_GRAYTEXT) ;
- wxString label = GetLabel();
- if ( state & ODS_NOACCEL ) label = GetLabelText() ;
- DrawButtonText(hdc, &rectBtn, label, colFg);
+ COLORREF colFg = state & ODS_DISABLED
+ ? ::GetSysColor(COLOR_GRAYTEXT)
+ : wxColourToRGB(GetForegroundColour());
+
+ // notice that DT_HIDEPREFIX doesn't work on old (pre-Windows 2000) systems
+ // but by happy coincidence ODS_NOACCEL is not used under them neither so
+ // DT_HIDEPREFIX should never be used there
+ DrawButtonText(hdc, &rectBtn, GetLabel(), colFg,
+ state & ODS_NOACCEL ? DT_HIDEPREFIX : 0);