Solved

Detecting mouse click on a control known only by handle

Posted on 2000-05-09
5
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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