how WM_CTLCOLOREDIT works ?
I''m trying to change the color of the edit control with WM_CTLCOLOREDIT message, but I don''t know why its not works. MSDN said that SendMessage(HWND, WM_CTLCOLOREDIT, (WPARAM)hdc, (LPARAM)hwnd), but .......
you respond to it in wndproc of the parent window.
in your wm_ctlcoloredit handler, you can use the HDC that''s in wParam to change background color and font for the edit control that sent you the message.
in your wm_ctlcoloredit handler, you can use the HDC that''s in wParam to change background color and font for the edit control that sent you the message.
Do you mean ?
HDC hdc;
SendMessage(HWND, WM_CTLCOLOREDIT, (WPARAM)hdc, (LPARAM)HWND);
SetBkColor(hdc, RGB(0,255,0));
HDC hdc;
SendMessage(HWND, WM_CTLCOLOREDIT, (WPARAM)hdc, (LPARAM)HWND);
SetBkColor(hdc, RGB(0,255,0));
no.
write a handler for wm_ctlcoloredit in your main wndproc.
call setbkcolor there using (HDC) wParam as the device context.
write a handler for wm_ctlcoloredit in your main wndproc.
call setbkcolor there using (HDC) wParam as the device context.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement