Reputation: 330862
I have an unmanaged app both in 32 bit and 64 bit on Windows 7 64.
I want to write a C# application to receive the keyboard messages it's receiving, so I could do certain things on certain key presses, and for others, simply send it back to the app, so as not to interfere with them.
I don't know the right way to search for this so not sure how this would be done.
Also I want to avoid using keyboard hooks if possible. Just want to receive the app's keyboard messages is what I am trying to do.
Upvotes: 1
Views: 564
Reputation: 8008
See here about adding hooks to specific windows. I've no idea how to read the message pump of other apps. You can do it with a IMessageFilter but it only will work in the current app...
Upvotes: 1
Reputation: 283624
That's what keyboard hooks are designed for. There aren't any alternatives that don't have all the problems of keyboard hooks (and probably some additional ones).
Upvotes: 2