Private Declare Function apiAdjustWindowRect& Lib "user32" Alias "AdjustWindowRect" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Long)
Private Declare Function apiSetRect& Lib "user32" Alias "SetRect" (lpRect As RECT, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long)
Private Declare Function apiCopyRect& Lib "user32" Alias "CopyRect" (lpDestRect As RECT, lpSourceRect As RECT)
Private Declare Function apiInflateRect& Lib "user32" Alias "InflateRect" (lpRect As RECT, ByVal x As Long, ByVal y As Long)
Private Declare Function apiIntersectRect& Lib "user32" Alias "IntersectRect" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT)
Private Declare Function apiUnionRect& Lib "user32" Alias "UnionRect" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT)
Private Declare Function apiSubtractRect& Lib "user32" Alias "SubtractRect" (lprcDst As RECT, lprcSrc1 As RECT, lprcSrc2 As RECT)
Private Declare Function apiOffsetRect& Lib "user32" Alias "OffsetRect" (lpRect As RECT, ByVal x As Long, ByVal y As Long)
Private Declare Function apiEqualRect& Lib "user32" Alias "EqualRect" (lpRect1 As RECT, lpRect2 As RECT)
Private Declare Function apiPtInRect& Lib "user32" Alias "PtInRect" (lpRect As RECT, ByVal ptx As Long, ByVal pty As Long)
Private Declare Function apiAdjustWindowRectEx& Lib "user32" Alias "AdjustWindowRectEx" (lpRect As RECT, ByVal dsStyle As Long, ByVal bMenu As Long, ByVal dwEsStyle As Long)
Private Declare Function apiSetRectEmpty& Lib "user32" Alias "SetRectEmpty" (lpRect As RECT)
Private Declare Function apiIsRectEmpty& Lib "user32" Alias "IsRectEmpty" (lpRect As RECT)
#Else ' WIN16
Private Declare Function apiAdjustWindowRect% Lib "user" Alias "AdjustWindowRect" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Integer)
Private Declare Function apiSetRect% Lib "user" Alias "SetRect" (lpRect As RECT, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer)
Private Declare Function apiCopyRect% Lib "user" Alias "CopyRect" (lpDestRect As RECT, lpSourceRect As RECT)
Private Declare Function apiInflateRect% Lib "user" Alias "InflateRect" (lpRect As RECT, ByVal x As Integer, ByVal y As Integer)
Private Declare Function apiIntersectRect% Lib "user" Alias "IntersectRect" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT)
Private Declare Function apiUnionRect% Lib "user" Alias "UnionRect" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT)
Private Declare Function apiSubtractRect% Lib "user" Alias "SubtractRect" (lprcDest As RECT, lprcSource1 As RECT, lprcSource2 As RECT)
Private Declare Function apiOffsetRect% Lib "user" Alias "OffsetRect" (lpRect As RECT, ByVal x As Integer, ByVal y As Integer)
Private Declare Function apiEqualRect% Lib "user" Alias "EqualRect" (lpRect1 As RECT, lpRect2 As RECT)
Private Declare Function apiPtInRect% Lib "user" Alias "PtInRect" (lpRect As RECT, ByVal pnt As Long)
Private Declare Function apiAdjustWindowRectEx% Lib "user" Alias "AdjustWindowRectEx" (lpRect As RECT, ByVal dsStyle As Long, ByVal bMenu As Integer, ByVal dwEsStyle As Long)
Private Declare Function apiSetRectEmpty% Lib "user" Alias "SetRectEmpty" (lpRect As RECT)
Private Declare Function apiIsRectEmpty% Lib "user" Alias "IsRectEmpty" (lpRect As RECT)
#End If 'WIN16
Private Sub Class_Initialize()
' Initialization is not actually necessary because
' class variables are all set to zero. Here's how it could be done:
' Call apiSetRectEmpty(InternalRect)
End Sub
Public Property Get left() As Long
left = InternalRect.left
End Property
Public Property Let left(vNewValue As Long)
InternalRect.left = vNewValue
End Property
Public Property Get right() As Long
right = InternalRect.right
End Property
Public Property Let right(vNewValue As Long)
InternalRect.right = vNewValue
End Property
Public Property Get top() As Long
top = InternalRect.top
End Property
Public Property Let top(vNewValue As Long)
InternalRect.top = vNewValue
End Property
Public Property Get bottom() As Long
bottom = InternalRect.bottom
End Property
Public Property Let bottom(vNewValue As Long)
InternalRect.bottom = vNewValue
End Property
Public Sub AdjustWindowRect(ByVal dwStyle&, ByVal bMenu As Boolean)
Attribute AdjustWindowRect.VB_HelpID = 2956
Attribute AdjustWindowRect.VB_Description = "Help available in Visual Basic Programmer's Guide to Win32 API CD ROM"