BOOL On_WM_CTLCOLOREDIT(HWND dialog, HDC control_DC, HWND control)
{
int control_ID = 0;
control_ID = GetDlgCtrlID(control);
switch (control_identifier) {
case IDC_SWITCHES:
if (gp_data->Is_Switches_Set() == false) {
SetTextColor(control_DC, gp_data->Get_Inactive_Colour());
}
SetBkColor(control_DC, gp_data->Get_Bk_Colour_RW());
returnreinterpret_cast<BOOL>(gp_data->Get_Bk_Brush_RW());
case IDC_ARGUMENTS:
if (gp_data->Is_Arguments_Set() == false) {
SetTextColor(control_DC, gp_data->Get_Inactive_Colour());
}
SetBkColor(control_DC, gp_data->Get_Bk_Colour_RW());
returnreinterpret_cast<BOOL>(gp_data->Get_Bk_Brush_RW());
default:
return FALSE;
}
}
Part of the time this works as expected. However, once I call GetWindowText(), use the Edit_GetText() macro or even send the raw WM_GETTEXT message to the control its text colour reverts to the default black.
Have any of you chaps encountered this behaviour? Is there any way around it? It seems like a bug in the common control library, but I totally accept I may be missing something obvious somewhere.