/// <summary> /// 卸载钩子 /// </summary> public void UnInstallHook() { bool isSuccess = false; if (khook != IntPtr.Zero) { isSuccess = Win32Helper.UnhookWindowsHookEx(khook); this.khook = IntPtr.Zero; } //if (isSuccess) //{ // MessageBox.Show("卸载成功!"); //} //else //{ // MessageBox.Show("卸载失败!"); //} }
/// <summary> /// 卸载鼠标钩子 /// </summary> public void UnInstallHook() { bool isSuccess = false; if (this.hHook != IntPtr.Zero) { isSuccess = Win32Helper.UnhookWindowsHookEx(hHook); this.hHook = IntPtr.Zero; } if (isSuccess) { MessageBox.Show("卸载成功!"); } else { MessageBox.Show("卸载失败!"); } }