在winform时候,经常需要做屏蔽系统热键: 1.屏蔽左"WIN".右"Win" 2.屏蔽Ctrl+Esc 3.屏蔽Alt+f4 4.屏蔽Alt+Esc 5.屏蔽Alt+Tab 6.截获Ctrl+Shift+Esc 7.截获Ctrl+Alt+Delete ...... public class Hook : IDisposable { //委托 public delegate int HookProc(int nCode, int wParam, IntPtr l
最近做的一个winform类型的项目中需要屏蔽系统热键,在网上搜索了一下,基本上都是调用api来进行hook操作,下面的代码就可以完成功能 using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WAT.PMS { /// <summary> /// Description