Problem using OnKeyDown in CDialog ????
-
Hi, I'm using MFC Visual C++ and encountered a problem using OnKeyDown() function. The problem is that I don't get response from keyboard even if I included all the requirements. MyDlgClass.cpp ...... ...... ON_WM_KEYDOWN ...... ...... void CMyDlgClass::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { ................ CDialog::OnKeyDown(nChar, nRepCnt, nFlags); I think, the problem is that the focus wasn't on the dialog but on other objects. If I'm correct how can I possibly shift focus to the dialog or get response from the keyboard? Hope somebody can help me, thanks. }
-
Hi, I'm using MFC Visual C++ and encountered a problem using OnKeyDown() function. The problem is that I don't get response from keyboard even if I included all the requirements. MyDlgClass.cpp ...... ...... ON_WM_KEYDOWN ...... ...... void CMyDlgClass::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { ................ CDialog::OnKeyDown(nChar, nRepCnt, nFlags); I think, the problem is that the focus wasn't on the dialog but on other objects. If I'm correct how can I possibly shift focus to the dialog or get response from the keyboard? Hope somebody can help me, thanks. }
Do you have any controls on the dialog?
-
Do you have any controls on the dialog?
Hamid. wrote:
Do you have any controls on the dialog?
Yes, CButtons and CEdit controls.
-
Hamid. wrote:
Do you have any controls on the dialog?
Yes, CButtons and CEdit controls.
So you can use of PreTranslateMessage.
-
So you can use of PreTranslateMessage.
Ok, Thanks a lot. I'll try this.
-
Ok, Thanks a lot. I'll try this.
You can use of those events,but you dont have any control on the dialog. ;)