Sending Keyboard Macro Commands to Game Windows

后端 未结 5 1022
离开以前
离开以前 2021-02-06 18:25

I wanna do a macro program for a game. But there is a problem with sending keys to only game application (game window). I am using keybd_event API for sending keys

5条回答
  •  梦如初夏
    2021-02-06 19:22

    FindWindow API:
    http://www.pinvoke.net/default.aspx/user32.FindWindowEx

    SendMessage API:
    http://www.pinvoke.net/default.aspx/user32/SendMessage.html

    VB

    Private Const WM_KEYDOWN As Integer = &H100
    Private Const WM_KEYUP As Integer = &H101
    

    C#

    private static int WM_KEYDOWN = 0x100
    private static int WM_KEYUP = 0x101
    

提交回复
热议问题