getwindowrect的问题
Public Class Form1
Private Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Integer, ByVal lpRect As rect) As Integer
Public Structure rect
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
End Structure
Dim f As rect
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GetWindowRect(Me.Handle, f)
End Sub
End Class
出现以下错误:
在 System.AccessViolationException 中第一次偶然出现的“GetWindowRect.exe”类型的异常
请问怎么解决