using System.Runtime.InteropServices;
//注册热键的api
[DllImport("user32")]
public static extern bool RegisterHotKey(IntPtr hWnd,int
id,uint control,Keys vk );
//解除注册热键的api
[DllImport("user32")]
public static extern bool UnregisterHotKey(IntPtr hWnd, int
id);
protected override void WndProc(ref Message m)
MessageBox.Show("我按了BUTTON键");//这里可以改改,比如button1_Click(this,EventArgs.Empty);