diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-07 03:39:47 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-07 03:39:47 -0400 |
| commit | 54dd1f40017dc31cc5f302cf67cd15ecb562daa1 (patch) | |
| tree | 10da4eb50f3dd26dfd4e1f01f1c9aa4bc1067c68 /new/window_windows.c | |
| parent | c4045909606cbc7733846ef7ca482d27bddd2e30 (diff) | |
Hooked up resizing. Now to make a control that uses this.
Diffstat (limited to 'new/window_windows.c')
| -rw-r--r-- | new/window_windows.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/new/window_windows.c b/new/window_windows.c index c0ca6c3..d5f675e 100644 --- a/new/window_windows.c +++ b/new/window_windows.c @@ -3,6 +3,7 @@ struct uiWindow { HWND hwnd; + uiControl *child; BOOL shownOnce; int (*onClosing)(uiWindow *, void *); void *onClosingData; @@ -15,6 +16,8 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA uiWindow *w; CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam; LRESULT lResult; + WINDOWPOS *wp = (WINDOWPOS *) lParam; + RECT r; w = (uiWindow *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); if (w == NULL) { @@ -26,6 +29,15 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult) != FALSE) return lResult; switch (uMsg) { + case WM_WINDOWPOSCHANGING: + if (w->child == NULL) + break; + if ((wp->flags & SWP_NOSIZE) != 0) + break; + if (GetClientRect(w->hwnd, &r) == 0) + logLastError("error getting window client rect for resize in uiWindowWndProc()"); + resize(w->child, w->hwnd, r); + return 0; case WM_CLOSE: if (!(*(w->onClosing))(w, w->onClosingData)) return 0; |
