Estaba programando Cuadros de Diálogos, a los controles Edit y Radio Button,
les cambiaba el background y color de la fuente, ningún problema.
Ahora estaba programando ventanas sin recurrir a recursos, ahora no puedo hacer que se modifique
los colores de los controles, ejemplo;
Código:
  
#include <windows.h>
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
HINSTANCE inst;
/*-----------------------*/
#define CB_OCULTAR  10
#define RB_RADIO_1  11
#define RB_RADIO_2  12
#define BG_GRUPO    13
#define RB_RADIO_3  14
#define RB_RADIO_4  15
//-----
#define EstiloRadios    WS_CHILD | WS_VISIBLE |BS_AUTORADIOBUTTON
#define EstiloGrupos    WS_CHILD | WS_VISIBLE | BS_GROUPBOX | WS_GROUP
#define EstiloEdit      WS_CHILD | WS_VISIBLE | WS_BORDER
//
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static HWND hedit,hboton,hradio_1,hradio_2;
    static HWND hgrupo;
    static HWND hradio_3,hradio_4;
    int optar = 11;
    //--- COLOR BACKGROUND CONTROLES
    static HBRUSH RadioBrush;
    static COLORREF BkRadioColor;
    static COLORREF TextoRadio;
Código:
  
switch (message)
    {
        case WM_CREATE:
            hgrupo = CreateWindow(
                        
                        "button","OPciones",
                        EstiloGrupos, 15,70,150,80,
                        hwnd,(HMENU)BG_GRUPO,
                        inst,NULL
                        );
            hradio_1 = CreateWindow(
                        
                        "Button","Marcar",
                        EstiloRadios, 30,88,60,20,
                        hwnd,(HMENU)RB_RADIO_1,
                        inst,NULL
                        );
		....etc...
	    hradio_4 = CreateWindow(
                        
                        "button","Marca 4",
                        EstiloRadios, 30,192,70,20,
                        hwnd,(HMENU)RB_RADIO_4,
                        inst, NULL
                        );
            //---------
            TextoRadio = RGB(0,0,254);
            BkRadioColor = RGB(225,225,225);
            RadioBrush = CreateSolidBrush(BkRadioColor);
            break;
        case WM_CTLCOLORBTN:
            if((HWND)lParam == (HWND)RB_RADIO_4)
            {
                SetTextColor((HDC)wParam,TextoRadio);
                SetBkColor((HDC)wParam,BkRadioColor);
                return (LONG)RadioBrush;
            }
            break;
Código:
  
No se que estoy haciendo mal, gracias.        case WM_DESTROY:
            DeleteObject(RadioBrush);
            PostQuitMessage (0);
            break;
Nos vemos.
 
