Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Detecting when the mouse moves off the form

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
rocca
Asked:
rocca
  • 2
  • 2
1 Solution
 
mark2150Commented:
Lost focus on your form should do it.
M

0
 
MirkwoodCommented:
Download the HotTrack sample from the Microsoft Owners side

http://premium.microsoft.com/vbasic/
0
 
MirkwoodCommented:
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
 
roccaAuthor Commented:
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
 
roccaAuthor Commented:
Mirkwood:  Sure that would be great, my email is Peter.Rocca@LHSC.ON.CA - thanks again.
0

Featured Post

Industry Leaders: 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!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now