Implemented WM_PAINT for uiParent on Windows. It seems to work...

This commit is contained in:
Pietro Gagliardi 2015-04-18 20:20:47 -04:00
parent dc2967619c
commit 92474f94af
1 changed files with 9 additions and 0 deletions

View File

@ -115,6 +115,8 @@ static LRESULT CALLBACK parentWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
NMHDR *nm = (NMHDR *) lParam;
WINDOWPOS *wp = (WINDOWPOS *) lParam;
RECT r, margin;
HDC dc;
PAINTSTRUCT ps;
// these must always be executed, even on the initial parent
// why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx
@ -180,6 +182,13 @@ static LRESULT CALLBACK parentWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
margin.bottom = pp->marginBottom;
resize(pp->mainControl, pp->hwnd, r, margin);
return 0;
case WM_PAINT:
dc = BeginPaint(pp->hwnd, &ps);
if (dc == NULL)
logLastError("TODO write this");
paintControlBackground(pp->hwnd, dc);
EndPaint(pp->hwnd, &ps);
return 0;
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);