mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-12 14:45:21 +08:00
check for NULL when attaching to foreground window
Should fix Issue #66 thanks to joerg.bornemann for the patch
This commit is contained in:
@@ -156,6 +156,9 @@ attachThreadToForeground()
|
||||
// already in the right thread.
|
||||
if (g_hookThread != 0) {
|
||||
HWND window = GetForegroundWindow();
|
||||
if (window == NULL)
|
||||
return false;
|
||||
|
||||
DWORD threadID = GetWindowThreadProcessId(window, NULL);
|
||||
// skip if no change
|
||||
if (g_attachedThread != threadID) {
|
||||
|
||||
Reference in New Issue
Block a user