WM_MOUSEMOVE event inside ActiveX Control 
Author Message
 WM_MOUSEMOVE event inside ActiveX Control

Hello,

I have a CFormView with an embedded ActiveX control. I wish to monitor mouse
movement across the ActiveX control. I have added a WM_MOUSEMOVE event
handler to the CFormView but this only works when the mouse is not over the
ActiveX control. Is there any way of enabling the event handler for the
control as well?

It would also be useful to know whether the mouse was over the control or
over the CFormView.

Cheers,
Clive.



Sun, 11 Sep 2005 15:25:47 GMT  
 WM_MOUSEMOVE event inside ActiveX Control
Hi Clive,

Many AX controls expose OnMouseXXXX events directly, so you can often just
use Class Wizard to add handlers for them. To see if that is the case, try
this: Selecting your view in the Class name combo, along with the the ID of
the AX control in the Object IDs listbox. If the event you are interested in
is available, you should OnMouseMove (and NOT WM_MOUSEMOVE) listed directly
in the Messages listbox.

If the above fails and you are hooking up the AX control to an MFC
Wizard-generated control wrapper, you might try deriving your own class from
the wrapper class. Then hook the control up to a member variable of your own
class in lieu of the MFC class. By doing this, you may be able to add
WM_MOUSEMOVE handlers to your own wrapper, and can then forward them
yourself to your CFormView parent either by private messages, or by giving
your wrapper a pointer to your view so you may call it directly.

If you are *not* using the MFC wrapper (or if #2 fails to work properly),
they you can still create your own CWnd based wrapper; which you will then
hook up to the control using either SubclassWindow or SubclassDlgItem in
your CFormView's OnInitialUpdate, or with DDX_Control in your view's
DoDataExchange method.

Regards,
Mike


Quote:
> Hello,

> I have a CFormView with an embedded ActiveX control. I wish to monitor
mouse
> movement across the ActiveX control. I have added a WM_MOUSEMOVE event
> handler to the CFormView but this only works when the mouse is not over
the
> ActiveX control. Is there any way of enabling the event handler for the
> control as well?

> It would also be useful to know whether the mouse was over the control or
> over the CFormView.

> Cheers,
> Clive.



Mon, 12 Sep 2005 16:14:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. getting key events from inside an ActiveX control hosted in a CView

2. ActiveX control inside another activex control

3. ActiveX control inside another ActiveX control

4. ActiveX-control inside ActiveX-control

5. get WM_MOUSEMOVE event outside of my control

6. Help - Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

7. Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

8. Tooltips on controls (buttons, widgets etc) inside an ActiveX Control

9. Handling ActiveX control events without an ActiveX container

10. Create ActiveX Control at runtime inside ActiveX Control, how to handle event(s)?

11. Controlling an event of an ActiveX control

12. Continuous WM_MOUSEMOVE events

 

 
Powered by phpBB® Forum Software