aboutsummaryrefslogtreecommitdiff
path: root/c/win.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-11 23:13:56 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-11 23:13:56 +0200
commitb159ee4f5caa71a85a9ebfa8ee9558a7fcbb8929 (patch)
tree02e6402177bf50ddc4540b0216c77cf462dba942 /c/win.cpp
parent618f9bcf02ed8291e352cfea09f8f207930d5af4 (diff)
downloadEpisodeBrowser-b159ee4f5caa71a85a9ebfa8ee9558a7fcbb8929.tar.gz
Fix bug in CenterNextWindow.
Diffstat (limited to 'c/win.cpp')
-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) {