OnKillFocus question
-
I'd like to do something if a view in my MDI app loses focus to another view, but not if it loses focus to a dialog or message box. OnKillFocus gives me a pointer to the new CWnd, so is there a safe way to check if that is a CView? thanks, Jake
-
I'd like to do something if a view in my MDI app loses focus to another view, but not if it loses focus to a dialog or message box. OnKillFocus gives me a pointer to the new CWnd, so is there a safe way to check if that is a CView? thanks, Jake
I think you may use
pWnd->IsKindOf(RUNTIME_CLASS(CView))
- look in MSDN for that function (from CObject). Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski) -
I'd like to do something if a view in my MDI app loses focus to another view, but not if it loses focus to a dialog or message box. OnKillFocus gives me a pointer to the new CWnd, so is there a safe way to check if that is a CView? thanks, Jake
You can try this: CWnd* m_wnd; (pointer you get from OnKillFocus) if (m_wnd->IsKindOf(RUNTIME_CLASS(CView))) // Its a CView else // Its not a CView Bret Faller Odyssey Computing, Inc.
-
You can try this: CWnd* m_wnd; (pointer you get from OnKillFocus) if (m_wnd->IsKindOf(RUNTIME_CLASS(CView))) // Its a CView else // Its not a CView Bret Faller Odyssey Computing, Inc.
I have an OnKillFocus handler on an edit control. If the user presses the window close ("x") button while the focus is on the control, I would like to handle the WM_CLOSE message, however the KillFocus message is being generated first. How can I either determine in the OnKillFocus handler that the user pressed the "x" button, or alternately, what message can I handle that would occur before the KillFocus. As a last resort, is there any way to disable the "x" button? Thanks,