corno
asked on
Why don't my mnemonic keys work?
I have created an application which has modeless dialog boxes. I have defined (in the resource editor) mnemonic keys for the various controls -- for example, &Close for a pushbutton that says "Close". Right now, when the dialog box has the focus (blue title bar instead of gray), pressing the mnemonic keys has absolutely no effect. Hitting tab to move among the controls also has no effect. My application also has a mainframe menu, with mnemonic keys defined (&File so that Alt-F brings up the File menu). These work.
Is there a reason for this seeming inconsistency?
Is there a reason for this seeming inconsistency?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, I was looking in VC 5.0. In Visual C++ 5.0, there are two functions: PreTranslateMessage and PreTranslateInput. In a dialog's PreTranslateMessage, it calls PreTranslateInput, so make sure your dialog's PreTranslateMessage is getting called.
ASKER
I tried overloading my Dialog box's PreTranslateMessage like so:
BOOL SysSpewSystemDlg::PreTrans lateMessag e(MSG* pMsg)
{
if (IsDialogMessage(pMsg))
return TRUE;
else
return CWnd::PreTranslateMessage( pMsg);
}
It still doesn't work. Am I doing something wrong?
ps. if you feel the points for this question are not enough, I will increase them. I thought it would be relatively simple to solve.
BOOL SysSpewSystemDlg::PreTrans
{
if (IsDialogMessage(pMsg))
return TRUE;
else
return CWnd::PreTranslateMessage(
}
It still doesn't work. Am I doing something wrong?
ps. if you feel the points for this question are not enough, I will increase them. I thought it would be relatively simple to solve.
At this point, I would try creating another dialog, but this time keep it as simple as possible. Does it work for you then? If it does not, then the problem is not in the dialog, but rather something else in the application preventing it from working. If it does, then the problem is in your dialog class and you need to find out what is different.
ASKER
I'm sorry. It still doesn't work. However, you provided me with some leads so I'm not going to reject this answer.
Thanks
Thanks
ASKER