المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Simulate keypress



C# Programming
01-21-2010, 11:10 PM
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.