Detect Keyboard key press using VC6.0

Status
Not open for further replies.

KH

Junior Member level 1
Joined
Nov 1, 2004
Messages
15
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
103
onkeydown() in cdialog + vc6.0

I wrote a simple dialog based program using MFC wizard to detect any key press, but the program is not responding to any key pressed. What is missing ?

Below is the message handle codes, the empty function is created using ClassWizard

void CTestingDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
MessageBox("Key pressed", "Error", MB_ICONERROR | MB_OK);
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}

Thanks.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…