diff options
-rw-r--r-- | c/win32.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/c/win32.cpp b/c/win32.cpp index 2ecea50..fa5116d 100644 --- a/c/win32.cpp +++ b/c/win32.cpp @@ -30,8 +30,10 @@ void WithNextWindow(void (*proc)(HWND)) * that static storage must be used, as SetWindowHookEx cannot * accept a capturing lambda as the hook procedure. */ - static thread_local auto procNext = proc; - static thread_local HHOOK hHook = Require(SetWindowsHookExW(WH_CBT, [](const int nCode, + static thread_local void (*procNext)(HWND); + static thread_local HHOOK hHook; + procNext = proc; + hHook = Require(SetWindowsHookExW(WH_CBT, [](const int nCode, const WPARAM wParam, const LPARAM lParam) -> LRESULT CALLBACK { if (nCode == HCBT_CREATEWND) { |