We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b81d49e commit 63b74a7Copy full SHA for 63b74a7
src/win32/window_manager.cc
@@ -18,7 +18,11 @@ std::vector<WindowHandle> getWindows() {
18
}
19
20
WindowHandle getActiveWindow() {
21
- return reinterpret_cast<WindowHandle>(GetForegroundWindow());
+ HWND foregroundWindow = GetForegroundWindow();
22
+ if (foregroundWindow != NULL) {
23
+ return reinterpret_cast<WindowHandle>(foregroundWindow);
24
+ }
25
+ return -1;
26
27
28
MMRect getWindowRect(const WindowHandle windowHandle) {
0 commit comments