mirror of
https://github.com/debauchee/barrier.git
synced 2025-06-25 05:57:02 +02: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:
parent
f96c2b3572
commit
25d8110ed2
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue