Groupbox keeps not repaint itselfs on window resizing
I have written a program in which I have 2 splitters and 3 controls (subwindows). While resizing splitter (window) in which groupox is contained, groupbox does not repaint its frames ( I think so). What do I wrongly?
Code:
case WM_SIZE:
{
if (info == NULL)
break;
if (info->horizontal)
{
/*
If window is shrunk so that splitter now lies outside the
window boundaries, move the splitter within the window.
*/
if ((wParam != SIZE_MINIMIZED) && (HIWORD(lParam) < info->dwSplitterPos))
info->dwSplitterPos = HIWORD(lParam) - 10;
/* Adjust the children's size and position */
MoveWindow(info->hWnd1, 0, 0, LOWORD(lParam), info->dwSplitterPos - 1, TRUE);
MoveWindow(info->hWnd2, 0, info->dwSplitterPos+2, LOWORD(lParam) , HIWORD(lParam) - info->dwSplitterPos - 2, TRUE);
}
else
{
if ((wParam != SIZE_MINIMIZED) && (LOWORD(lParam) < info->dwSplitterPos))
info->dwSplitterPos = LOWORD(lParam) - 10;
MoveWindow(info->hWnd1, 0, 0, info->dwSplitterPos - 1, HIWORD(lParam), TRUE);
MoveWindow(info->hWnd2, info->dwSplitterPos+2, 0, LOWORD(lParam) - info->dwSplitterPos - 2, HIWORD(lParam) , TRUE);
}
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
return 0;
}
--EDIT-- After covering window and uncovering window repaints correctly (maximizing and minimizing windows make the window to repaint itself also).
Incorrect drawing means the window leaves grayish unpainted mix of colors within the new added space (by moving splitter)
Last edited by duga; October 31st, 2012 at 04:59 PM.
Reason: Some details added
Bookmarks