How to handle WM_KEYDOWN in a Dialog???
Posted on 2002-04-24
I have a problem.
I'm writing a standard application
on Visual C++, using Win32 and
the ATL classes included in
the headers ATLBase.h and ATLWin.h.
I use my own classes derived from:
CMyWindow : public CWindowImpl<CMyWindow>
CMyDialog : public CDialogImpl<CMyDialog>
I make my main window,
and then open a dialog at some time.
My question is:
How to handle for example the WM_KEYDOWN message in this
I want when I press for example "Alt+A" and the focus
is in any of the controls in the dialog, this WM_KEYDOWN message to be handled from a single function
not from this control's WM_KEYDOWN handler.
If this would help, I want to make the same as the Form KeyPreview property in Visual Basic does.
The WM_KEYDOWN should be handled somehow firstly by the dialog, and
then by the concreate control.
How could I do this???
Thank you in advance.
Pavel Tsekov, Varna, Bulgaria