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.
|
// already in the right thread.
|
||||||
if (g_hookThread != 0) {
|
if (g_hookThread != 0) {
|
||||||
HWND window = GetForegroundWindow();
|
HWND window = GetForegroundWindow();
|
||||||
|
if (window == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
DWORD threadID = GetWindowThreadProcessId(window, NULL);
|
DWORD threadID = GetWindowThreadProcessId(window, NULL);
|
||||||
// skip if no change
|
// skip if no change
|
||||||
if (g_attachedThread != threadID) {
|
if (g_attachedThread != threadID) {
|
||||||
|
|
Loading…
Reference in New Issue