Am using code below to display memory
status. Problem with 4th and 5th ones
(dwTotalPageFile and dwAvailPageFile).
They show up as NEGATIVE. Why might
that be?
'xxxxxxxxxxxxxxxBEGIN SNIPPETxxxxxxxxxxxxx
Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Private Declare Sub GlobalMemoryStatus Lib "kernel32" _
(lpBuffer As MEMORYSTATUS)
Private Sub Form_Load()
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
Label1.Caption = Format$(MS.dwMemoryLoad, "###,###,###,###") & " %
used"
Label2.Caption = Format$(MS.dwTotalPhys / 1024, "###,###,###,###")
& " Kbyte"
Label3.Caption = Format$(MS.dwAvailPhys / 1024, "###,###,###,###")
& " Kbyte"
Label4.Caption = Format$(MS.dwTotalPageFile / 1024,
"###,###,###,###") & " Kbyte"
Label5.Caption = Format$(MS.dwAvailPageFile / 1024,
"###,###,###,###") & " Kbyte"
Label6.Caption = Format$(MS.dwTotalVirtual / 1024,
"###,###,###,###") & " Kbyte"
Label7.Caption = Format$(MS.dwAvailVirtual / 1024,
"###,###,###,###") & " Kbyte"
End Sub