Solved

Detecting when the mouse moves off the form

Posted on 1998-11-09
5
154 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
Comment Utility
Lost focus on your form should do it.
M

0
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Mirkwood:  Sure that would be great, my email is Peter.Rocca@LHSC.ON.CA - thanks again.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now