Last active
July 4, 2020 07:13
-
-
Save kusa-mochi/c537789048040eb24e6720f82369e9fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Process currentProcess = Process.GetCurrentProcess ()) | |
using (ProcessModule currentModule = currentProcess.MainModule) { | |
// メソッドをマウスのイベントに紐づける。 | |
_mouseHookId = NativeMethods.SetWindowsHookEx ( | |
NativeMethods.HookType.WH_MOUSE_LL, | |
_mouseProc, | |
NativeMethods.GetModuleHandle (currentModule.ModuleName), | |
0 | |
); | |
// メソッドをキーボードのイベントに紐づける。 | |
_keyboardHookId = NativeMethods.SetWindowsHookEx ( | |
(int)NativeMethods.HookType.WH_KEYBOARD_LL, | |
_keyboardProc, | |
NativeMethods.GetModuleHandle (currentModule.ModuleName), | |
0 | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment