?
Solved

Mouse Capture

Posted on 1997-10-12
10
Medium Priority
?
438 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

719 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