Hi John,
Thank you for posting in the community!
Based on my understanding, you want to intercept the key stroke of another
application.
========================================
Normally, you can use hook to intercept key stroke in C#, for more
information, please refer to:
"HOW TO: Set a Windows Hook in Visual C# .NET"
http://support.microsoft.com/default.aspx?scid=kb;en-us;318804
This KB installs mouse hook, you can modify it and use keyboard hook.
But, as you want to intercept another application's key stroke, then a
global hook is needed. In the KB, you will see that:
"Global Hook Is Not Supported in .NET Framework
You cannot implement global hooks in Microsoft .NET Framework. To install a
global hook, a hook must have a native dynamic-link library (DLL) export to
inject itself in another process that requires a valid, consistent function
to call into. This requires a DLL export, which .NET Framework does not
support. Managed code has no concept of a consistent value for a function
pointer because these function pointers are proxies that are built
dynamically."
So you can not get this done in .Net. So you should do it in Win32
environment, please Klaus's suggestion to search in google, there will be a
lot of discussion about get this done in Win32 SDK.
=====================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice weekend!!
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.