Hey, I'm developing application and want to simulate mouse/keyboard events in other program (game). Now I'm using SendMessage() api to simulate those events. The problem is i cant do anything on computer meanwh开发者_如何转开发ile. So I was thinking if its possible to send those events to program thats running in background so it doesnt have to be active window. Is that even possible or should i just run this in virtual machine?
I think you want Post Message.
Paul DiLascia has written a great article http://msdn.microsoft.com/en-us/magazine/cc301431.aspx There could be other reasons. But Posting is probably better, and not flooding the message Q.
精彩评论