我想模拟ctr+alt+del按键,给系统发按键消息,然后就像按了键盘一样,弹出任务管理器。该怎么实现。主要是如何向系统发送按键消息,而不是想调出任务管理器。请不要回答直接调用任务管理器的应用程序。

解决方案 »

  1.   

     DefWndProc(ref Message m)
     方法里面捕获WM_KEYUP,WM_KEYDOWN消息
      

  2.   

    SendKeys.Send("^a");发送组合键
    SendKeys.Send("^v");//模拟键盘按键Ctrl+v"粘贴"using System.RunTime.InteropServices;
    private const int WM_LBUTTONDOWN = 513; // 0x0201   
    private const int WM_LBUTTONUP = 514; // 0x0202   
    [System.Runtime.InteropServices.DllImport( "user32.dll ")]   
    static extern bool SendMessage(IntPtr hWnd, Int32 msg, Int32 wParam, Int32 lParam);   private void SetNoCurrentCell()   
    {   
      SendMessage(Form2.Handle, WM_LBUTTONDOWN, 0, 0);   
      SendMessage(Form2.Handle, WM_LBUTTONUP, 0, 0);