首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

为何调用ScreenToClient api无效

2011-12-17 
为什么调用ScreenToClient api无效?VB.NET codeDeclare Function GetCursorPos Lib user32 Alias GetCu

为什么调用ScreenToClient api无效?

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 LongDim 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

热点排行