diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-11 23:13:56 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-11 23:13:56 +0200 |
commit | b159ee4f5caa71a85a9ebfa8ee9558a7fcbb8929 (patch) | |
tree | 02e6402177bf50ddc4540b0216c77cf462dba942 | |
parent | 618f9bcf02ed8291e352cfea09f8f207930d5af4 (diff) | |
download | EpisodeBrowser-b159ee4f5caa71a85a9ebfa8ee9558a7fcbb8929.tar.gz |
Fix bug in CenterNextWindow.
-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) { |