public void UnHook() { if (WindowsHookExHandle != null && !WindowsHookExHandle.IsClosed && !WindowsHookExHandle.IsInvalid) { WindowsHookExHandle.Dispose(); } WindowsHookExHandle = null; }
static void StopListening() { s_oldHook.Dispose(); s_oldHook = null; }