Solved

Adding an Event to ActiveX control created from DLL

Posted on 2004-10-04
2
164 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
ID: 12225281
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
ID: 12227094
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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