PreTranslate Message problem
-
hi all, i have a class derived from CDialogImpl<>,i want to catch the Message WM_Keydown, and identify if that key is esc then dont close the dialog. i have managed to do that in MFC application using Pretranslate function but that function is not working in ATL class, i have tried to override DialogProc() but this function also not called, similaraly other option like CMessage::PreTranslateMessage and but same result these function are not called. how to get equalent of MFC's PreTranslateMessage() in this class.
Regards. Tasleem Arif
-
hi all, i have a class derived from CDialogImpl<>,i want to catch the Message WM_Keydown, and identify if that key is esc then dont close the dialog. i have managed to do that in MFC application using Pretranslate function but that function is not working in ATL class, i have tried to override DialogProc() but this function also not called, similaraly other option like CMessage::PreTranslateMessage and but same result these function are not called. how to get equalent of MFC's PreTranslateMessage() in this class.
Regards. Tasleem Arif
What about overriding CDialogImpl::DialogProc()? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
hi all, i have a class derived from CDialogImpl<>,i want to catch the Message WM_Keydown, and identify if that key is esc then dont close the dialog. i have managed to do that in MFC application using Pretranslate function but that function is not working in ATL class, i have tried to override DialogProc() but this function also not called, similaraly other option like CMessage::PreTranslateMessage and but same result these function are not called. how to get equalent of MFC's PreTranslateMessage() in this class.
Regards. Tasleem Arif
You can Override OnCancel(); Like this!. void YourClassName::OnCancel() { // TODO: Add your specialized code here and/or call the base class CDialog::OnCancel(); }
Thanks and Regards. SANTHOSH V
-
You can Override OnCancel(); Like this!. void YourClassName::OnCancel() { // TODO: Add your specialized code here and/or call the base class CDialog::OnCancel(); }
Thanks and Regards. SANTHOSH V
-
What about overriding CDialogImpl::DialogProc()? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
i override that function but did not worked either. here was code i was using
static virtual LRESULT CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); LRESULT CMiniBubbleDialog::DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { WriteEventLog1("Proc called"); switch(uMsg) { case WM_MOVE: WriteEventLog1("Mouse is moved"); break; case WM_LBUTTONDOWN: WriteEventLog1("Lbutton Down"); } return 0; }
but did not worked.Regards. Tasleem Arif
-
i override that function but did not worked either. here was code i was using
static virtual LRESULT CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); LRESULT CMiniBubbleDialog::DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { WriteEventLog1("Proc called"); switch(uMsg) { case WM_MOVE: WriteEventLog1("Mouse is moved"); break; case WM_LBUTTONDOWN: WriteEventLog1("Lbutton Down"); } return 0; }
but did not worked.Regards. Tasleem Arif
Maybe override CDialogImpl::GetDialogProc() and return a pointer to your dialog proc. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: