c# Sending keyboard commands to another window / process

后端 未结 3 1372
温柔的废话
温柔的废话 2020-12-01 07:58

I am trying to write a program that will take a line of data and pass it into another window / process.

This is the code I have so far, but I have not been able to w

3条回答
  •  一个人的身影
    2020-12-01 08:51

    I've written a couple of programs that send keystrokes to background windows, I generally implemented PostMessage/SendMessage. I documented all my findings here!

    But you will basically be using a low level c call to put messages into the windows message queue to allow the application to pick up the key presses.

    PostMessage

    SendMessage

    Please let me know if you have any questions, my library is written in C# and i'd be happy to share it. This method also allows for mouse use in a background window :)

    All code was checked into GitHub: https://github.com/EasyAsABC123/Keyboard

提交回复
热议问题