'on the form1 in the appropiate events
'Declarations
Option Explicit
Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags as
Integer) as
Long
Declare Function GetSystemDirectory Lib "Kernel" (ByVal lpBuffer as
String, ByVal nSize as
Integer) as
Integer
Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer as
String, ByVal nSize as
Integer) as
Integer
Declare Function GetWinFlags& Lib "Kernel" ()
Declare Function GetHeapSpaces& Lib "Kernel" (ByVal hModule as
Integer)
Declare Function GetFileVersionInfo% Lib "VER.DLL" (ByVal lpszFileName$, ByVal handle as
Any, ByVal cbBuf&, ByVal lpvData$)
Declare Function GetVersion Lib "kernel" () as
Long
Declare Function GetModuleHandle Lib "Kernel" (ByVal lpModuleName as
String) as
Integer
Dim dosver$, winver$, windir$, sysdir$, wmode$, mchip$
Function GetFreeResources (ModuleName$)
dim
rInfo&, Totalr&, FreeR&
rInfo& = GetHeapSpaces&(GetModuleHandle(ModuleName$))
Totalr& = rInfo& \ &H10000 'hi word
If Totalr& < 0 Then Totalr& = Totalr& + &H10000
FreeR& = rInfo& Mod &H10000 'lo word
If FreeR& < 0 Then FreeR& = FreeR& + &H10000
GetFreeResources = FreeR& * 100 \ Totalr&
End Function
Sub Form_Load ()
dim
buff$, TChars%, ver&, dosver1!
dim
ret%, pos%, flag&
buff$ = Space$(255)
TChars% = GetWindowsDirectory(buff$, 255)
windir$ = Left$(buff$, TChars%)
buff$ = Space$(255)
TChars% = GetSystemDirectory(buff$, 255)
sysdir$ = Left$(buff$, TChars%)
ver& = GetVersion() / 65536
dosver1! = ver& / 256
dosver1! = dosver1! + (ver& Mod 256) / 100
dosver$ = Format$(Trim$(Str$(dosver1!)), "#.00")
dim
version as
String * 255
version = Space$(255)
ret% = GetFileVersionInfo%("user.exe", 0&, 254, version)
pos% = InStr(1, version, "FileVersion")
winver$ = Format$(Mid$(version, pos% + 12, 4), "##.00")
flag& = GetWinFlags&()
If flag& And &H20 Then wmode$ = "Enhanced" Else wmode$ = "Standard"
If flag& And &H400 Then mchip$ = "Yes" Else mchip$ = "No"
End Sub
Sub Form_Paint ()
currentY = 100
Print " Windows Dir"; Tab(18); windir$
Print " System Dir "; Tab(18); sysdir$
Print " Memory "; Tab(18); Format$(GetFreeSpace(0) \ 1024); " KB Free"
Print " GDI rsrc "; Tab(18); Format$(GetFreeResources("GDI"), "##"); "% Free"
Print " User rsrc "; Tab(18); Format$(GetFreeResources("USER"), "##"); "% Free"
Print " Win ver "; Tab(18); winver$
Print " DOS ver "; Tab(18); dosver$
Print " Mode "; Tab(18); wmode$
Print " Math Chip "; Tab(18); mchip$
End Sub
Return