开发者

How to receive the windows messages of an unmanaged Win32 and Win64 app in C#?

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 t开发者_Go百科he app's keyboard messages is what I am trying to do.


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).


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜