I just create an interactive project in MFC (VS2008) and add OnKeyDown to the dialog. When I start the project and press the keys on the keyboard, nothing happens. But, if I remove all the controls from the dialog and restart the project, it will work. What should I do to receive key events, even if I have controls in a dialog box?
Here is the code snippet:
void CgDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {
source share