We have a legacy application in Win32, we are building new modules using WPF. We have a situation where we need to notify the WPF window of a particular shotcut key message invoked on a win32 window. My question is, is there a way to handle the keyboard messages on WPF window invoked on a win32 window? If so what do I need to do to achieve it?
Thanks,
Ub
What you need is a keyboard hook. Hooks can be global or application-wide. In your specific case I think application-wide is enough.
So, what you need is to get the Handle of the Win32 process and hook the message to filter the WM_KEYDOWN messages. Here is an example:
http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx