Make your own free website on

[an error occurred while processing this directive]
Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type
Private Declare Function CopyRect Lib "user32" (lpDestRect As RECT, lpSourceRect As RECT) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Sub Form_Load()
    'KPD-Team 1999
    Dim rectWindow As RECT, rectCopy As RECT
    'Get the bounding rectangle of this window
    GetWindowRect Me.hwnd, rectWindow
    'Copy the rectangle
    CopyRect rectCopy, rectWindow
    MsgBox "This form's width:" + Str$(rectCopy.Right - rectCopy.Left) + " pixels"
End Sub

Copyright © 1998-2000, The KPD-Team.
Send mail to with comments about this web site.
This site is located at