Focus in an MDI program 
Author Message
 Focus in an MDI program

Hi Mark,

I'm not sure exactly what your looking for but the window that gets the
focus when an MDI app is activated is the last window within that app that
had the input focus when the app lost focus (when an other app or shortcut
on the desktop was brought to the foreground).

In an MFC dialog or form view, the parent frame or view keeps track of
which child had the focus before going out of focus with a statement
similar to:

m_hFocusWnd = ::GetFocus();

When it gets the focus again it gives that child input focus with a
statement similar to:

::SetFocus(m_hFocusWnd);

Hope this helps.

--
Jean-Fran?ois Davignon
Conservationist and programmer



Quote:
> When you reestablish focus to an MDI MFC app, what window gets focus?

> It's not CMainFrame, I can find it in spy, but I can't find the class.
> It's also not the window that previously had focus, because that's the
> problem I'm having, reestablishing focus to the window that previously
had
> it.

> --




Tue, 18 Jan 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Creating MDI child windows without focus

2. MDI application, window title bar not reflecting focus

3. Help: MDI ActiveX Document (Excel) does not hide its toolbars when it loses focus

4. Setting focus on MDI child windows

5. Help (Again): MDI ActiveX Document (Excel) does not hide its toolbars when it loses focus

6. Help: MDI ActiveX Document (Excel) does not hide its toolbars when it loses focus

7. Window Focus Problems with MDI App

8. focus in mdi app

9. Setting focus to an MDI child

10. Help (Again): MDI ActiveX Document (Excel) does not hide its toolbars when it loses focus

11. Looking for a journal focus on database and internet programming

12. launching an EXE from my program, BUT without focus changes

 

 
Powered by phpBB® Forum Software