I use this code frequently, even inside messages received by the CallBack function. It's easy to remember and works just fine.
But what I don't do very often is extract the mouse location from the message parameters, like these examples:
For all of the possible mouse notifications, can the mouse location be found in exactly the same way? Or, do the various mouse/button/cursor notifications sometimes provide the position in different ways?
The question would be then, do anyone have something that documents all of the various ways to get the mouse position? My snippets library doesn't have a consolidation, just examples in a variety of snippets.
Code:
GetCursorPos pt : ScreenToClient hDlg, pt
Code:
Local pt as Point Case %WM_ContextMenu pt.x = Lo(Integer,Cb.LParam) : pt.y = Hi(Integer, Cb.LParam) Case %WM_MouseMove 'returns client coordinates pt.x = Lo(Integer,CB.lParam) : pt.y = Hi(Integer,CB.lParam) Case %WM_LButtonUp pt.x = Lo(Integer,CB.LParam) : pt.y = Hi(Integer,Cb.LParam) Case %WM_LButtonDown pt.x = Lo(Integer,Cb.LParam) : pt.y = Hi(Integer,Cb.LParam)
The question would be then, do anyone have something that documents all of the various ways to get the mouse position? My snippets library doesn't have a consolidation, just examples in a variety of snippets.
Comment