diff options
Diffstat (limited to 'c')
-rw-r--r-- | c/win.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -36,9 +36,13 @@ static void CenterNextWindow(HWND hWnd) * is delayed until the new window is activated. This * complicates the code somewhat. */ - static __thread HWND hWndParent = hWnd; - static __thread HWND hWndNext = nullptr; - static __thread HHOOK hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, + static __thread HWND hWndParent; + static __thread HWND hWndNext; + static __thread HHOOK hHook; + + hWndParent = hWnd; + hWndNext = nullptr; + hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, const WPARAM wParam, const LPARAM lParam) noexcept -> LRESULT CALLBACK { if (!hWndNext && nCode == HCBT_CREATEWND) { |