M
Matt
I'm having problems changing the text colors in an edit box in my program.
Here's what I'm trying to do, under WM_CREATE I have the following:
ClockFace = CreateWindowEx(0,
"EDIT",
"0.0.00",
WS_CHILD|WS_VISIBLE|WS_BORDER,
125,
75,
300,
100,
hwnd,
HMENU(CLOCKWINDOW),
NULL,
NULL);
HFONT StopFont =
CreateFont(100,24,0,0,700,200,0,0,0,0,0,0,0,TEXT("Verdana"));
SendMessage(ClockFace, WM_SETFONT, WPARAM(StopFont),
MAKELPARAM(0,0));
hdc = GetDC(ClockFace); //tried putting this section under
WM_CTLCOLOREDIT, still didn't work
SetTextColor(hdc, RGB(0, 200, 0));
SetBkColor(hdc, RGB(0, 0, 0));
However, when I compile this I still get the standard black lettering and
white background. I think my problem lies in how I'm getting the DC handle.
I first tried typecasting the ClockFace HWND variable to a HDC but that
didn't work, but apparently GetDC isn't solving my problems either. How can
I fix this? Thanks for any help.
Here's what I'm trying to do, under WM_CREATE I have the following:
ClockFace = CreateWindowEx(0,
"EDIT",
"0.0.00",
WS_CHILD|WS_VISIBLE|WS_BORDER,
125,
75,
300,
100,
hwnd,
HMENU(CLOCKWINDOW),
NULL,
NULL);
HFONT StopFont =
CreateFont(100,24,0,0,700,200,0,0,0,0,0,0,0,TEXT("Verdana"));
SendMessage(ClockFace, WM_SETFONT, WPARAM(StopFont),
MAKELPARAM(0,0));
hdc = GetDC(ClockFace); //tried putting this section under
WM_CTLCOLOREDIT, still didn't work
SetTextColor(hdc, RGB(0, 200, 0));
SetBkColor(hdc, RGB(0, 0, 0));
However, when I compile this I still get the standard black lettering and
white background. I think my problem lies in how I'm getting the DC handle.
I first tried typecasting the ClockFace HWND variable to a HDC but that
didn't work, but apparently GetDC isn't solving my problems either. How can
I fix this? Thanks for any help.