I understood you would better use the ex function
Public Structure MEMORYSTATUSEX
Public dwLength As Integer
Public dwMemoryLoad As Integer
Public ullTotalPhys As ULong
Public ullAvailPhys As ULong
Public ullTotalPageFile As ULong
Public ullAvailPageFile As ULong
Public ullTotalVirtual As ULong
Public ullAvailVirtual As ULong
Public ullAvailExtendedVirtual As ULong
End Structure
<DllImport("kernel32.dll", SetLastError := True)_
Private Shared Function GlobalMemoryStatusEx(ByRef lpBuffer As
MEMORYSTATUSEX) As Boolean
End Function
'
Public Function GetTotalMemory() As ULong
Dim memStat As New MEMORYSTATUSEX()
memStat.dwLength = 64
Dim b As Boolean = GlobalMemoryStatusEx(memStat)
Return memStat.ullTotalPhys
End Function
regards
Michel
"snow" <ba**********@yahoo.comschreef in bericht
news:11**********************@i13g2000prf.googlegr oups.com...
Hi All,
I used GlobalMemoryStatus API function checking RAM memory in my
windows application, it worked fine. Recently there are some 64 bit
Windows XP user complain that they got error message from memory
check. How can I check 64 bit windows correctly?
Thanks!