Solved

Adding an Event to ActiveX control created from DLL

Posted on 2004-10-04
2
161 Views
Last Modified: 2010-04-05
I need to know how to add an Event to an ActiveX control I imported from a type library (DLL).  As I received it, the control works fine but only fires a few Drag Events, OnEnter and OnExit.  Before posting here I searched on the forums, but all the answers I could find assume I am creating an ActiveX control or Active Form from scratch, but I am using a DLL compiled in C++ that does not fire the events I want.  I need to be able to track the mouse position inside this control.  An example of how to add OnClick or Mousedown to such an ActiveX control would be very helpful.

Also any other workaround to track mouse position and clicks inside an ActiveX container would be sufficient.

Thanks!
0
Comment
Question by:whfolsom4
2 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 125 total points
Comment Utility
If it doesn't fire the events you want, then you're out of luck. It's the C++ code that will have to shoot those events in the first place. If it doesn't, well... Tough!

To track the mouse events, you might use the OnMouseMove events of the control below the ActiveX control. If not, you'll have to install a mousehook message handler. Not a pretty solution, though.
0
 

Author Comment

by:whfolsom4
Comment Utility
Thanks, I did end up installing a mousehook message handler in the form of TApplicationEvents component.  Otherwise, it looks like the parent control receives no events when the mouse if over the ActiveX control.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now