aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-07 00:32:33 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-07 00:32:33 +0200
commit5b1a07607ba593050e37598f731f833b6faabee4 (patch)
tree1f1e651e29ce432a9b9734c460719e84ad83fc97
parent5fd0444805a85a7bb48ae49232ec3b02b5bc1cd9 (diff)
downloadEpisodeBrowser-5b1a07607ba593050e37598f731f833b6faabee4.tar.gz
Fix WithNextWindow bug.
-rw-r--r--c/win32.cpp6
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) {