For Windows, when you press a key the system redirect this event to the active window and if that event is captured in that window then the corresponding handler will be called.
So, you cannot intercept in your Form the CTRL pressed key while it is not active.
A sample example. Let say you are running Windows 2000.
You have open Netscape, VS 2003 and IE.
If all three are inactive and you press F1 then the Windows 200 Help is displayed. If IE is active and press F1 then IE Help is displayed. If Netscape is active and press F1 then NetHelp Netscape is displayed.
-obislavu-
Just a Note...
CTRL + ALT + Del combination is filtered out before message is sent to active window. The code for this is in a system library (I think GINA.DLL which is to do with I/O routines).
Yes, Ctrl+Alt+Del is the Secure Attention Sequence (SAS), and the operating system will filter it out before any user windows see it. Note that this only applies to real operating systems like XP Pro, Win2k, etc. The XP Home and Win 9x don't count, as they aren't secure.
Microsoft does, however, provide a way to capture this yourself -- you write a custom GINA DLL. Note that this is a difficult task. If you plan to develop one, you'll need VC++ (NOT C#!), and a copy of VirtualPC (If you make any mistakes, you can't log in, so best to do your testing in a environment you can easily restore).
Chip H.
If you want to get the best response to a question, please check out FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.