Doing stuff when certain Key combo's pushed
I'm sure this is easy for someone, so here goes. I have a dialog based app that accepts use input. When a user hits something like alt and 2 at the same time, I want to change all the text to * or something. How do I check for the key combo being pressed?
-HisWord
Getting Char Messages on Dialog Apps
Funny you ask. I had the same problem a while back. Try this:
PreTranslateMessage is a virtual function that you must add trough the class wizard. This works I just tried it.
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
//do this or the other
MessageBox("Aha!");
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}