getwindowrect的问题

xiaoxiaoxiaoabc 2010-07-18 08:22:41
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”类型的异常

请问怎么解决

...全文
184 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2010-07-18
  • 打赏
  • 举报
回复
Declare Function GetWindowRect Lib "user32 " Alias "GetWindowRect " (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer
古今多少事 2010-07-18
  • 打赏
  • 举报
回复
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧