感觉还是比较有些用处的,特别是在定位窗体的时候:)
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click()
Dim rct As RECT
GetWindowRect Text1.hwnd, rct
Me.Print rct.Left
Me.Print rct.Top
Me.Print rct.Bottom
Me.Print rct.Right
End Sub
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click()
Dim rct As RECT
GetWindowRect Text1.hwnd, rct
Me.Print rct.Left
Me.Print rct.Top
Me.Print rct.Bottom
Me.Print rct.Right
End Sub