- VB.NET code
Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (ByRef lpPoint As POINTAPI) As Long Declare Function ScreenToClient Lib "user32 " Alias "ScreenToClient" (ByRef hwnd As Integer, ByRef lpPoint As POINTAPI) As Long Dim pi As POINTAPI = New POINTAPI GetCursorPos(pi) Dim hWnd As Integer = ListView1.Handle.ToInt32 ScreenToClient(hWnd, pi)
ListView1是一个列表控件,GetCursorPos调用成功,ScreenToClient调用后pi的值不变,为什么?
------解决方案--------------------
直接用.net方法即可。
------解决方案--------------------
http://pinvoke.net/default.aspx/user32/ScreenToClient.html