Solved

Detecting mouse click on a control known only by handle

Posted on 2000-05-09
5
147 Views
Last Modified: 2010-04-04
How can I detect a mouse click on a windowed control that I only know by its handle? The parent of the window is also known (a panel). Is it possible to create a transparent label and set its parent to the control?
0
Comment
Question by:Keijo
5 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2792183
Which control are you having problems with?

The Neil =:)
0
 

Author Comment

by:Keijo
ID: 2792207
It's a window created by Video for Windows capCreateCaptureWindow function. Too bad I only get the handle of the created window out of that function, not exactly easy to work with standard delhpi functions...
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2792220
Ahh...I see

What I'd suggest (and I don't know if it'll work or how to do it) is to monitor the Windows messages and then react to mouse clicks for the window with the handle you got back from capCreateCaptureWindow. Sorry, can't be any more help than that

The Neil =:(
0
 
LVL 6

Expert Comment

by:edey
ID: 2792969
I belive for this you need to use a system level mouse hook, you can find an example here:

http://www.delphifreestuff.com/examples/winhook.zip

there is also an example of a very interesting technique here:

http://www.delphifreestuff.com/examples/hookmethod.html


GL
Mike
0
 

Accepted Solution

by:
SERENNE earned 100 total points
ID: 2809819
if you want to detect the mouse click on a control use the event Onclick and send a system message with postmessage.
On the main window , use the WndProc function. Catch the message you send by postmessage.

you'll have a notifycation when the mouse is pressed on the control.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

13 Experts available now in Live!

Get 1:1 Help Now