WM_MOUSEACTIVATE capture in MDI 
Author Message
 WM_MOUSEACTIVATE capture in MDI

Hi All,

    I have a MDI application. I need to figure out a way to identfy a
situation when a MDI child window is activated (brought to front) by mouse
clicking on it.

E.G.
Say there are 2 MDI child windows wnd1 and wnd2
At a given time if wnd1 is active and wnd2 is in the background, if the user
clicks on wnd2 to get it to front then I need to captue that event.

    I tried using OnMouseActivate() method in the MDI child window, but it
keeps getting called even when the user clicks on it while it is the MDI
active child. My need is to isolate the MDIActivate() call happenning only
when the mouse is clicked.

Thank You,
Saman



Wed, 09 Nov 2005 12:53:13 GMT  
 WM_MOUSEACTIVATE capture in MDI
Take a look at code in winmdi.cpp for the following two methods:

BOOL CMDIChildWnd::OnNcActivate(BOOL bActive)
int CMDIChildWnd::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT
message)

That should help you. Although overriding OnMDIActivate is the way to
intercept MDIActivation (or deactivation).  You would not need this if you
want to differentiate between mouse activation or activation thru some other
means.

--
Ajay Kalra [MVP - VC++]


Quote:
> Hi All,

>     I have a MDI application. I need to figure out a way to identfy a
> situation when a MDI child window is activated (brought to front) by mouse
> clicking on it.

> E.G.
> Say there are 2 MDI child windows wnd1 and wnd2
> At a given time if wnd1 is active and wnd2 is in the background, if the
user
> clicks on wnd2 to get it to front then I need to captue that event.

>     I tried using OnMouseActivate() method in the MDI child window, but it
> keeps getting called even when the user clicks on it while it is the MDI
> active child. My need is to isolate the MDIActivate() call happenning only
> when the mouse is clicked.

> Thank You,
> Saman



Wed, 09 Nov 2005 13:18:55 GMT  
 WM_MOUSEACTIVATE capture in MDI
See if my reply in vc.mfc group helps you. You should cross post instead of
making a separate post for each newsgroup.

--
Ajay Kalra [MVP - VC++]


Quote:
> Hi All,

>     I have a MDI application. I need to figure out a way to identfy a
> situation when a MDI child window is activated (brought to front) by mouse
> clicking on it.

> E.G.
> Say there are 2 MDI child windows wnd1 and wnd2
> At a given time if wnd1 is active and wnd2 is in the background, if the
user
> clicks on wnd2 to get it to front then I need to captue that event.

>     I tried using OnMouseActivate() method in the MDI child window, but it
> keeps getting called even when the user clicks on it while it is the MDI
> active child. My need is to isolate the MDIActivate() call happenning only
> when the mouse is clicked.

> Thank You,
> Saman



Wed, 09 Nov 2005 13:21:19 GMT  
 WM_MOUSEACTIVATE capture in MDI
Hi Ajay,

    Thanks for the response,  I tried debugging my code by putting some
breakpoints, it seems like in my application, OnMouseActivate() is always
getting called after calling MDIActivation() by the system. Still I couldn't
figure out why.

Thanks,
Saman


Quote:
> Take a look at code in winmdi.cpp for the following two methods:

> BOOL CMDIChildWnd::OnNcActivate(BOOL bActive)
> int CMDIChildWnd::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT
> message)

> That should help you. Although overriding OnMDIActivate is the way to
> intercept MDIActivation (or deactivation).  You would not need this if you
> want to differentiate between mouse activation or activation thru some
other
> means.

> --
> Ajay Kalra [MVP - VC++]



> > Hi All,

> >     I have a MDI application. I need to figure out a way to identfy a
> > situation when a MDI child window is activated (brought to front) by
mouse
> > clicking on it.

> > E.G.
> > Say there are 2 MDI child windows wnd1 and wnd2
> > At a given time if wnd1 is active and wnd2 is in the background, if the
> user
> > clicks on wnd2 to get it to front then I need to captue that event.

> >     I tried using OnMouseActivate() method in the MDI child window, but
it
> > keeps getting called even when the user clicks on it while it is the MDI
> > active child. My need is to isolate the MDIActivate() call happenning
only
> > when the mouse is clicked.

> > Thank You,
> > Saman



Wed, 09 Nov 2005 13:46:59 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WM_MOUSEACTIVATE capture in MDI

2. ASSERT in WM_MOUSEACTIVATE

3. Need understanding of WM_MOUSEACTIVATE behavior

4. DataView filter not working in MDI child forms with reference to MDI parent DataSet

5. MDI inside an MDI window (preferably via MFC)

6. MDI inside MDI -

7. MFC MDI Multiple Views in Separate MDI Child Windows

8. MDI inside MDI..

9. Opening a new MDI child when no MDI Child exists

10. Opening a new MDI child from a MDI Child

11. MDI app, relative modal MDI childs

12. Variables between MDI and MDI-child...

 

 
Powered by phpBB® Forum Software