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 GetWidHei(ByVal Hwnd As Long, W As Long, H As Long)
Dim RC As RECT, Rt As Long
Rt = GetWindowRect(Hwnd, RC)
If Rt > 0 Then
W = RC.Right - RC.Left
H = RC.Top - RC.Bottom
End If
End Sub