Simulate keypress
-
I have a requirement to be able to send keypresses to another application(yes this is the only option). I also cannot bring that application to the foreground(voiding the use of sendkeys). Ive found "postmessage" which does work, except that it seems to send the key directly to the program instead of simulating a keyboard press. So I need something that makes the application think it has come directly from the keyboard(which will also mean that another logging application I have will be able to pick the press up - as it doesnt with postmessage). Is there maybe a function that I can call with p/invoke? Thanks
Strive to be humble enough to take advice, and confident enough to do something about it.
-
I have a requirement to be able to send keypresses to another application(yes this is the only option). I also cannot bring that application to the foreground(voiding the use of sendkeys). Ive found "postmessage" which does work, except that it seems to send the key directly to the program instead of simulating a keyboard press. So I need something that makes the application think it has come directly from the keyboard(which will also mean that another logging application I have will be able to pick the press up - as it doesnt with postmessage). Is there maybe a function that I can call with p/invoke? Thanks
Strive to be humble enough to take advice, and confident enough to do something about it.
roguemat wrote:
I also cannot bring that application to the foreground(voiding the use of sendkeys).
Not sure if this is any help, but: Have you thought about bringing it to the foreground outside of the visible desktop area? You could bring the window up at -1000, -1000 (and make sure it's window size doesn't exceed that of course), use SendKey and put it back to its original position. May not be very elegant, but it should work.
Standards are great! Everybody should have one!