aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/win.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/c/win.cpp b/c/win.cpp
index a68d5b3..97e85a4 100644
--- a/c/win.cpp
+++ b/c/win.cpp
@@ -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) {