DefInt A-Z

Declare Function GetWinFlags Lib "Kernel" () As Long
Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags) As Long

Const WF_STANDARD = &H10
Const WF_ENHANCED = &H20
Const WF_80x87 = &H400

Sub Form_Load ()
Dim WinFlags As Long
Dim Mode As String, Processor As String

    ' Dialog Boxes should only have Move and Close items
    ' in their System menus', so remove the others.
    '
    Remove_Items_From_Sysmenu AboutBox

    ' Center the AboutBox on the screen
    '
     Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2

    ' Get current Windows configuration
    '
    WinFlags = GetWinFlags()

    ' Display configuration values in Lbl_Info.Caption and Lbl_InfoValues.Caption
    ' (NOTE: CRLF variable causes a line break in a labels caption)
    '
    If WinFlags And WF_ENHANCED Then Mode = "386 Enhanced Mode" Else Mode = "Standard Mode"
    Lbl_Info.Caption = Mode + Chr$(13) + Chr$(10) + "Free Memory:" + Chr$(13) + Chr$(10) + "Math Co-processor:"
    If WinFlags And WF_80x87 Then Processor = "Present" Else Processor = "None"
    Lbl_InfoValues.Caption = Chr$(13) + Chr$(10) + Format$(GetFreeSpace(0) \ 1024) + " KB" + Chr$(13) + Chr$(10) + Processor

End Sub

Sub Cmd_OK_Click ()

    Unload AboutBox

End Sub

