Hi everyone,

I've been googling this for a long time, and most of the hits are about keyboard shortcuts in the actual IDE... it's so annoying.. :(

I'm working on a pretty big VS project (about 20 source files).. I have to add some keyboard functionality to it... simple stuff like Ctrl+N for "new" and Left for "last [whatever]" and Right for "next [whatever]"..

I've looked into GetAsynchKeyState(), but I think that applies to any keystrokes (even outside the program), and moreover I don't know what number key maps to what...
I'm amazed there's no easy way of doing this.. I spent a while looking through the toolbox and found nothing.. :(

Thank you so much!

since you are using VC++ i am assuming you arein the .NET framework?

do you happen to be working with windows forms?


if so then you can capture keyboard input very easy on any form.

Thank you all for your replies,

I got it working eventually using PreTranslateMessage.

The problem was basically that I had a richedit box in my dialog and as soon as the dialog opened, the richedit box took focus and prevented me from being able the standard ways of assigning shortcuts..

This question has already been answered. Start a new discussion instead.