Hi,
This has got me pulling my hair out, all I want to do is get the cursor position within a client window in the same units as the window coordinates.
If I use;
to get the coordinates of the client window and;
to store them, then;
works fine. Now when I click in the client window, I can't work out how to retrieve the cursor postion relative to the client window in the same units as the client window.
I'm sure it can't be too hard, I'm just having trouble searching for it since most of the keywords one would use are rather common and return hundreds if not thousands of entries.
Would appreciate any ideas or tips and am using VB.Net 2005.
TIA
Andy
This has got me pulling my hair out, all I want to do is get the cursor position within a client window in the same units as the window coordinates.
If I use;
Code:
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer
Code:
Private Structure RECT Dim Left As Long Dim Top As Long Dim Right As Long Dim Bottom As Long End Structure
Code:
Dim CR as RECT GetClientRect(m_LastHwnd, CR)
I'm sure it can't be too hard, I'm just having trouble searching for it since most of the keywords one would use are rather common and return hundreds if not thousands of entries.
Would appreciate any ideas or tips and am using VB.Net 2005.
TIA
Andy