Solved

Detecting mouse click on a control known only by handle

Posted on 2000-05-09
5
149 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 158
delphi exception 7 64
add combobox item based on numbers 9 144
Base1 Encode/Decode 3 77
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

823 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