Click here to Skip to main content
15,891,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I've got a big problem. I tried searching over the internet but nothing found. So my Question is ;

How Can I catch Ctrl+F1 or any other key presses by the user and respond to that ? (maybe show a message)

Please Answer !!!
Posted

 
Share this answer
 
If you are using MFC then you may override PreTranslateMessage (have a look at Newcomer's: "When to use or not use PreTranslateMessage"[^]). If you are using Win32 instead then, the message pump is there, waiting for your intervention.
 
Share this answer
 
v2
Comments
elgaabeb 16-Dec-11 8:44am    
Hi,
I completely agree with you. I'll just add a precision about win32 api.
When using Win32 API, I think that he should make a keyboard event hook then make a keyboad event message queu and wait to have "ctrl" keydown msg then "c" keydown msg to catch the ctrl + c event.

EL GAABEB.
elgaabeb 16-Dec-11 8:44am    
my 4 :).
Use the KeyEventArgs.Control Property[^], refer to the C++ example in the same link.
 
Share this answer
 
v5
Comments
Captain Price 6-Jul-12 12:56pm    
that's .NET

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900