SendMessage, When To Use KEYDOWN, SYSKEYDOWN, etc?

后端 未结 1 359
小蘑菇
小蘑菇 2021-01-19 07:41

I am writing an application that sends keystrokes to another application using SendMessage.

[DllImport(\"user32.dll\")]
public static extern in         


        
相关标签:
1条回答
  • 2021-01-19 08:39

    Microsoft explains the difference between these WM messages here Keyboard Input (Windows).

    WM_SYSKEYDOWN simulates system commands like ALT + TAB used to switch windows.

    WM_CHAR simulates user input like input in a text box for instance.

    WM_KEYDOWN is usually used together with WM_KEYUP. See WM_KEYDOWN message (Windows).

    Most probably you will want to use WM_CHAR.

    0 讨论(0)
提交回复
热议问题