diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-09 14:10:29 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-09 14:10:29 -0400 |
| commit | 05fbbc491e9318f29243a1b185c386e7c554423c (patch) | |
| tree | ac3b8fe8bab130c919417f1cd7c24f1ca524ea5b /windowspopover/main.c | |
| parent | a29717405dcd74cef538522390b7c0974fed851d (diff) | |
Shifted things around in the Windows popover to properly build client rect sizes.
Diffstat (limited to 'windowspopover/main.c')
| -rw-r--r-- | windowspopover/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/windowspopover/main.c b/windowspopover/main.c index 118cd21..e4ac600 100644 --- a/windowspopover/main.c +++ b/windowspopover/main.c @@ -39,10 +39,11 @@ LRESULT CALLBACK popoverproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) HDC dc; HRGN region; POINT pt; + RECT r; switch (uMsg) { - case WM_PAINT: - dc = BeginPaint(hwnd, &ps); + case WM_NCPAINT: + dc = GetDCEx(hwnd, (HRGN) wParam, DCX_WINDOW | DCX_INTERSECTRGN); if (dc == NULL) abort(); BeginPath(dc); pt.x = 0; @@ -68,10 +69,16 @@ LRESULT CALLBACK popoverproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) region = PathToRegion(dc); FrameRgn(dc, region, GetStockObject(BLACK_PEN), 1, 1); SetWindowRgn(hwnd, region, TRUE); - EndPaint(hwnd, &ps); + ReleaseDC(hwnd, dc); return 0; case WM_NCCALCSIZE: break; + case WM_PAINT: + dc = BeginPaint(hwnd, &ps); + GetClientRect(hwnd, &r); + FillRect(dc, &r, GetSysColorBrush(COLOR_ACTIVECAPTION)); + EndPaint(hwnd, &ps); + return 0; } return DefWindowProcW(hwnd, uMsg, wParam, lParam); } |
