Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - GlobalMemoryStatus

Posted in WinTask

'
' GlobalMemoryStatus
'

' "kernel32.dll" alias "GlobalMemoryStatus"          (lpBuffer as MEMORYSTATUS)
'
'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

dim ptr as unsigned
dim ptr2 as unsigned
ptr=allocate(32)

ret=External("kernel32.dll","GlobalMemoryStatus",ptr)

ptr2=ptr+4
var=peekinteger(ptr2,4)
msgbox("Memory Load % ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+8
var=peekinteger(ptr2,4)
msgbox("Total Physical Memory ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+12
var=peekinteger(ptr2,4)
msgbox("Avail Physical Memory ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+16
var=peekinteger(ptr2,4)
msgbox("Total Page File Size ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+20
var=peekinteger(ptr2,4)
msgbox("Avail Page File Size ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+24
var=peekinteger(ptr2,4)
msgbox("Total Virtual ="+str$(var),,"GlobalMemoryStatus")

ptr2=ptr+28
var=peekinteger(ptr2,4)
msgbox("Avail Virtual ="+str$(var),,"GlobalMemoryStatus")


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now