I am working on making my program fully color customizable through a dialoog where the user can choose color on a ChooseColor common dialog.
This color scheme is saved on COLORREF vars and later on a ini file.
Everything is working except for a weird bug: Whenever i set the color for a control, i have to minimize and restore the window in order for the color to show on the control.
What command do you think i should be using in order to update/fully redraw the window and its controls ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
um jay, that can also casue bugs InvalidateRect(hWnd, NULL, TRUE); is like SendMessage(hWnd, WM_PAINT,0,0);
try setting the colors in WM_PAINT
also depending on what control you want to colr you meay need to reference it though WM_CTLCOLORBTN: or WM_CTLCOLOREDIT: or WM_CTLCOLORSTATIC or WM_CTLCOLORDLG NB: wm_ctlcoloredit doesnt work with richedits
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on making my program fully color customizable through a dialoog where the user can choose color on a ChooseColor common dialog.
This color scheme is saved on COLORREF vars and later on a ini file.
Everything is working except for a weird bug: Whenever i set the color for a control, i have to minimize and restore the window in order for the color to show on the control.
What command do you think i should be using in order to update/fully redraw the window and its controls ?
erm... did you try UpdateWindow(hwnd);???
Zero Valintine
I like the short answers..
I did it doesnt work.
Thats weird hun? :(
Maybe this will work..
// PAINTSRUCT ps;
// HDC hdc;
case WM_PAINT:
{
hdc = BeginPaint(hWnd, &ps);
InvalidateRect(hWnd, NULL, true);
EndPaint(hWnd, &ps);
break;
}
(in your windproc of course)
-Jay
um jay, that can also casue bugs InvalidateRect(hWnd, NULL, TRUE); is like SendMessage(hWnd, WM_PAINT,0,0);
try setting the colors in WM_PAINT
also depending on what control you want to colr you meay need to reference it though WM_CTLCOLORBTN: or WM_CTLCOLOREDIT: or WM_CTLCOLORSTATIC or WM_CTLCOLORDLG NB: wm_ctlcoloredit doesnt work with richedits
Maybe there some way for me to ask windows to redraw just a specific hwnd and not the entire window and all its controls?