How to implement CTRL-A keyboard shortcut in C ++

I want to implement some kind of action when pressing CTRL-A. How to do it in C ++ on Windows platform. I am using VS 2005.

Any pointers will help.

+1


source to share


2 answers


You need to define the keyboard accelerator table in your resources, and then make sure you call TranslateAccelerator in your message loop. See MSDN for details .



If you are using a framework (like MFC) it will have its own way of wrapping accelerators - you need to find them in the documentation for the framework you are using.

+1


source


You absolutely don't need an accelerator and the above code doesn't make any sense.
Just use HK. See MSDN and Google Groups for basic code (Win32)



0


source







All Articles