Sending Windows key using SendKeys

后端 未结 4 1573
滥情空心
滥情空心 2020-11-29 05:44

I am working on shortcuts in C#. I succeed implementing Ctrl, Alt and Shift with SendKeys.

Like this;

Ctrl + C:

System.         


        
4条回答
  •  不知归路
    2020-11-29 06:19

    SetForegroundWindow( /* window to gain focus */ );
    SendKeys.SendWait("^{ESC}"); // ^{ESC} is code for ctrl + esc which mimics the windows key.
    

提交回复
热议问题