0

I have a dialog with no controls derived from CDialogEx. I receive OnKeyDown() messages but never receive a OnChar() ? I even tried overriding PreTranslateMessage() and just returning 0 when receiving a WM_KEYDOWN message as a test, still no OnChar()? What am I missing so I don't have to use ToUnicode() or ToAscii() in the OnKeyDown() routine?

TIA!

df234987
  • 513
  • 2
  • 13
  • So if I wanted to take action on a + or - key press (either upper row or numeric keypad), do you have a sample? – df234987 Apr 08 '20 at 17:31
  • Without a control can receive keyboard focus in dialog box it seems can't receive key message/command (except `Enter` key). You may need create a custom dialog box. Please check [Creating Your Dialog Class](https://learn.microsoft.com/en-us/cpp/mfc/creating-your-dialog-class?view=vs-2019) to see if it helps. – Rita Han Apr 09 '20 at 09:00

0 Answers0