Skip to content

Commit

Permalink
Add hook workaround for Windows XP support
Browse files Browse the repository at this point in the history
  • Loading branch information
1280px authored Nov 11, 2022
1 parent 96449b0 commit 457a94e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Switchy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ int main(int argc, char** argv)
return 1;
}

hHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, 0, 0);
HINSTANCE hinst = GetModuleHandle(NULL);
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, hinst, 0);
if (hHook == NULL)
{
ShowError("Error calling \"SetWindowsHookEx(...)\"");
Expand Down Expand Up @@ -209,4 +210,4 @@ LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
}

return CallNextHookEx(hHook, nCode, wParam, lParam);
}
}

0 comments on commit 457a94e

Please sign in to comment.