diff options
Diffstat (limited to 'redo/window_windows.c')
| -rw-r--r-- | redo/window_windows.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/redo/window_windows.c b/redo/window_windows.c index 5ea83f1..e4ea875 100644 --- a/redo/window_windows.c +++ b/redo/window_windows.c @@ -9,21 +9,13 @@ static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA { void *data; RECT r; - LRESULT shared; + LRESULT lResult; - data = (void *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); - if (data == NULL) { - // the lpParam is available during WM_NCCREATE and WM_CREATE - if (uMsg == WM_NCCREATE) { - storelpParam(hwnd, lParam); - data = (void *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); - storeWindowHWND(data, hwnd); - } - // act as if we're not ready yet, even during WM_NCCREATE (nothing important to the switch statement below happens here anyway) - return DefWindowProcW(hwnd, uMsg, wParam, lParam); - } - if (sharedWndProc(hwnd, uMsg, wParam, lParam, &shared)) - return shared; + data = getWindowData(hwnd, uMsg, wParam, lParam, &lResult, storeWindowHWND); + if (data == NULL) + return lResult; + if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult)) + return lResult; switch (uMsg) { case WM_SIZE: if (GetClientRect(hwnd, &r) == 0) |
