-1

I'm using C#.

I have process file and I can send via PostMessage for example button 'W'.

I have idea how to make shortcut -> I want to spam each milisecond button "CTRL" (works for button "S" cuz I checked it) and then send "W" button.

But my problem is I don't know how to send 'CTRL" via PostMessage

Any suggestions?

1 Answers1

0

You can send it as any other key.
The code for Ctrl key is 0x11, so you would do:

PostMessage(handle, KEY_DOWN, 0x11 /*CTRL_KEY*/, 0);

Sorry, may bad. Based on this answer: https://stackoverflow.com/a/5145435/9748260, you cannot do that, and modifier keys cannot be simulated with SendMessage, so I guess this goes for PostMessage too.

Sohaib Jundi
  • 1,576
  • 2
  • 7
  • 15