[求助]同样使用下面API 在VB.net 2005 下报异常
Declare ...Declare ...
Structure POINTAPI
Dim x As Long
Dim y As Long
End Structure
Structure RECT
Dim Left As Long
Dim Top As Long
Dim Right As Long
Dim Bottom As Long
End Structure
' 设置每5秒触发一次
Private Sub Timer1_Tick(ByVal Sender As System.Object, ByBal e As System.EventArgs) Handles Timer1.Tick
Dim MyRect As RECT
Dim MyPoint As POINTAPI
' MyRect 返回当前窗口的位置
' 异常:尝试读取或写入受保护的内存。这通常指示其他内存已损坏
Call GetWindowRect(Me.Handle, MyRect)
' MyPoint 返回当前鼠标位置
' 异常:对PInvoke 函数"小程序! WindowsApplication1.SplashScreen3::GetCursoPos"的调用导致堆栈不对称。....
Call GetCursorPos(MyPoint)
End Sub
真是一波未平一波又起。