>>Houston,
>>
>>Somethig like two weeks ago, I did a class using GlobalMemoryStatus, but, looking at the results, I was afraid I did some mistake. Then I tried your function, and it returns the same values as mine.
>>In concrete there is an 8Kb difference with the total physical memory (in my machine). Both functions return 66.592.768, instead of 66.584.576 (reported by mem). My question is then, which one is the real value (not that it is important, just wondering why there is a difference)
>>
>>Hugo
>
>It underreports my memory by almost a megabyte, but it is close enough for what I want to do.
I know this is an old thread but something like two years ago I uploaded a dynamically memory resizing example and a DLL that returns the amount of memory, physical, virtual and so on. The sample will resize on a timer event to a watermark, attempting to optimise the amount of memory at any one time.
You should be able to find it by searching for obsysmem
Simon