public void hook() { if (hhook == IntPtr.Zero) { if (m_hLibrary == IntPtr.Zero) m_hLibrary = NativeMethods.LoadLibrary("User32"); hhook = NativeMethods.SetWindowsHookEx(NativeMethods.WH_KEYBOARD_LL, khp, m_hLibrary, 0); } }