Solved

Mouse Capture

Posted on 1997-10-12
10
433 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 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

10 Experts available now in Live!

Get 1:1 Help Now