Solved

Detecting when the mouse moves off the form

Posted on 1998-11-09
5
156 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
  • 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 92
How to debug this code 7 61
Microsoft Access combo box help 2 46
I need help embedding an image as HTML in my vb.net application 3 67
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

770 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