Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- LRESULT CALLBACK mouseProc (int nCode, WPARAM wParam, LPARAM lParam) {
- return 1;
- }
- DWORD WINAPI hookThread (LPVOID param) {
- HHOOK mouseHook = SetWindowsHookEx (WH_MOUSE_LL, mouseProc, GetModuleHandle (NULL), 0);
- MSG message;
- while (GetMessage (&message, NULL, 0, 0)) {
- TranslateMessage (&message);
- DispatchMessage (&message);
- }
- UnhookWindowsHookEx (mouseHook);
- return 0;
- }
- int main() {
- HANDLE thread = CreateThread (NULL, 0, hookThread, NULL, 0, NULL);
- WaitForSingleObject (thread, INFINITE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement