Messaging WPF and Win32

We have an outdated application in Win32, we are creating new modules using WPF. We have a situation where we need to notify the WPF window of a specific key key called in the win32 window. My question is, is there a way to handle keyboard messages in a WPF window called in a win32 window? If so, what do I need to do to achieve this?

Thanks Ub

+3
source share
1 answer

You need a hook for the keyboard. Hooks can be global or application. In your particular case, I think that for the whole application is enough.

So, you need to get the Win32 process handle and connect a message to filter WM_KEYDOWN messages. Here is an example:

http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx

+1

All Articles