- Private Declare Function GetDesktopWindow Lib "user32" () As Long
- Private Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (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 UserForm_Click()
- Dim a As RECT
- GetWindowRect GetDesktopWindow, a
- MsgBox a.Right - a.Left
- MsgBox a.Bottom - a.Top
- End Sub
|