Solved

Detecting when the mouse moves off the form

Posted on 1998-11-09
5
158 Views
Last Modified: 2010-04-30
I'm looking for a way of detecting when the mouse moves off the form, does anyone have any tips?  I've tried using the PeekMessage / TranslateMessage / DispatchMessage method and watched the messages, but if the mouse moves off the form onto the desktop I can't seem to see a message or pattern to let me know that its happened.
0
Comment
Question by:rocca
[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
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1443916
Lost focus on your form should do it.
M

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1443917
Download the HotTrack sample from the Microsoft Owners side

http://premium.microsoft.com/vbasic/
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 50 total points
ID: 1443918
I can mail you a project that has a tracker class. The tracker class has two event Enter and Leave and a property that is the hwnd.
0
 
LVL 1

Author Comment

by:rocca
ID: 1443919
Thank you very much Mirkwood, that was exactly what I needed!
(mark2150, the LostFocus doesn't trigger on moving the mouse off the form unfortunately, but thank you for replying)
0
 
LVL 1

Author Comment

by:rocca
ID: 1443920
Mirkwood:  Sure that would be great, my email is Peter.Rocca@LHSC.ON.CA - thanks again.
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 61
vbModal 12 66
Collapse and expand table in Word 2010 2 103
Fastest way to find and count same items VB6 16 47
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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