Reputation: 2842
if i am running my application i want to know where the mouse pointer is located(whether in the application or not ),i mean the position. suppose if mouse is located in the application then i want to raise a event, if mouse in my application then only i want to raise an event not if i am in any other sub window or in any other forms, it should rise the event whenever mouse pointer is leave from my application as well as cursur enter on my application....
how to use win32 on it.
Upvotes: 1
Views: 558
Reputation: 7163
You can capture the MouseEnter and MouseLeave events on both your forms and controls in order to do whatever you need to when the mouse is moved on (or off) your form.
Upvotes: 2
Reputation: 15546
Win32 function GetCursorPos can give you the exact location of the cursor regardless of the window. I don't know of a .NET alternative but you can always use win32 methods from C# through System.Runtime.InteropServices.DllImport.
Upvotes: 0