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
|
@ -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…
Reference in New Issue