コード例 #1
0
        private static void RegisterKeyboardHookMethod()
        {
            ProcessModule mainModule = Process.GetCurrentProcess().MainModule;

            SebKeyCapture.objKeyboardProcess = new SebKeyCapture.LowLevelProc(SebKeyCapture.CaptureKey);
            SebKeyCapture.objMouseProcess    = new SebKeyCapture.LowLevelProc(SebKeyCapture.CaptureMouseButton);
            SebKeyCapture.ptrKeyboardHook    = SebKeyCapture.SetWindowsHookEx(13, SebKeyCapture.objKeyboardProcess, SebKeyCapture.GetModuleHandle(mainModule.ModuleName), 0U);
            SebKeyCapture.ptrMouseHook       = SebKeyCapture.SetWindowsHookEx(14, SebKeyCapture.objMouseProcess, SebKeyCapture.GetModuleHandle(mainModule.ModuleName), 0U);
        }
コード例 #2
0
 private static extern IntPtr SetWindowsHookEx(int id, SebKeyCapture.LowLevelProc callback, IntPtr hMod, uint dwThreadId);