Solved

Mouse Capture

Posted on 1997-10-12
10
434 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
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.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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