Solved

Mouse Capture

Posted on 1997-10-12
10
437 Views
Last Modified: 2010-04-04
How do I pass a message that I have capture to the object that should receive the message?  Inherited does not seem to work.  Specifically, in a component is a trackbar. I capture the mouse.  When the user first tries to reposition the trackbar, the first attempt does not work, but release the capture of the mouse, so the next attempt works normally.  How can I get the first attempt to work normally?
0
Comment
Question by:charry
[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
  • 3
  • 2
10 Comments
 

Author Comment

by:charry
ID: 1347359
Edited text of question
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 1347360
How exactly are you 'capturing' the mouse?
0
 

Author Comment

by:charry
ID: 1347361
I am capturing the mouse by:
SetCapture(Self);

0
Technology Partners: 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!

 
LVL 12

Expert Comment

by:andrewjb
ID: 1347362
You're going to have to explain a bit more. I assume the form is doing the capturing? What for? I can't think of a neat way to pass the message on in that case, but there may be a different approach. More info, please!!
0
 

Author Comment

by:charry
ID: 1347363
My goal was to create a componet that included a Trackbar.  I wanted the component to have an option that the Trackbar would not be visible until the mouse was over the component.  Similarly, I wanted the Trackbar to again not be visible when the mouse moved off the component.  Geting the component to be visible was no issue using WM_MouseMove.  However, finding out when the mouse left the component has been the issue.  That is why I tried to capture the mouse.
I have worked arount this problem by using a timer and test the location of the mouse when the component is visible.  I don't like this method since I am generating many cycles that are not necessary.  

0
 
LVL 1

Accepted Solution

by:
Gabor earned 100 total points
ID: 1347364
Hi Charry,

Try the CM_MOUSEENTER and CM_MOUSELEAVE messages. I think it has to be work.

Good luck

Gabor
0
 

Author Comment

by:charry
ID: 1347365
Gabor,
I can not find any references to CM_MouseEnter/CM_MouseLeave.  Do you know where I can find information, I search MicroSoft without success. If not could you provide the syntax for these calls.
Thanks
charry
0
 
LVL 1

Expert Comment

by:Gabor
ID: 1347366
This is a custom BORLAND message. It is sent by the form to it's controls. You can't find any references, but it works! It's defined in the CONTROLS unit.

Good luck again!
0
 
LVL 1

Expert Comment

by:Gabor
ID: 1347367
Sorry, I forgot the 'syntax'.
You have to define a new control class. It has to have these two method:

procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;

The Msg parameter isn't relevant, because the message is sent to the control directly. By default it sends towards to his parent.
0
 

Author Comment

by:charry
ID: 1347368
How many hiden functions are they.  Thanks alot.  I wish I knew about these before, it would have save me much time.

Thanks
Chuck
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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month3 days, 14 hours left to enroll

630 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