Convert character to virtual key code

后端 未结 7 1454
说谎
说谎 2021-01-06 09:40

I have a string of values, and I want to simulate key press events in a window for each character.

I plan on sending WM_KEYDOWN, WM_CHAR, and WM_KEYUP events to the

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 10:04

    System.Windows.Forms.SendKeys is a WinForms class with static methods for simulating keyboard input on the active window.

    The catch is that .NET has no way of focusing windows in another application (the SendKeys docs talk about how to get around that).

提交回复
热议问题