比如 我实现做一个 Shift + CTRL + A 的功能 怎么坐那!

解决方案 »

  1.   

    sendkeys
    SendKeys.Send("+a");
    SHIFT  + 
    CTRL   ^ 
    ALT    % 
      

  2.   

    public static void Test()
    {
        Application.Run(new FormSample());
    }public class FormSample : Form
    {
        [DllImport("USER32 ", SetLastError = true)]
        static extern short GetKeyState(int nVirtKey);
        [DllImport("user32")]
        public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint control, Keys vk);//注册热键
        [DllImport("user32")]
        public static extern bool UnregisterHotKey(IntPtr hWnd, int id);//解除热键   
        public const int WM_HOTKEY = 0x312;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);        RegisterHotKey(this.Handle, 1, 4 | 2, Keys.A);
        }    protected override void WndProc(ref Message m)
        {
            if (m.Msg == WM_HOTKEY)
            {
                MessageBox.Show("ctrl+shift+a按下了");
            }
            base.WndProc(ref m);
        }
    }
      

  3.   

    补充一下 如果是shift + A + B 那