Solved

How much RAM?

Posted on 1998-04-01
4
152 Views
Last Modified: 2010-04-06
How can I detect how much RAM a user has in their PC?
0
Comment
Question by:qwalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1361161
procedure TForm1.Button1Click(Sender: TObject);
var   MS: TMemoryStatus;
begin
  GlobalMemoryStatus(MS);
  Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024);
end;

0
 

Author Comment

by:qwalker
ID: 1361162
Oops, sorry, I forgot to mention I am using Delphi v1.
0
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 20 total points
ID: 1361163
Hi,

Use an API function called MemManInfo.  It returns a record called MemManInfo.  Heres the structure for it:

  TMemManInfo = record
    dwSize: Longint;
    dwLargestFreeBlock: Longint;
    dwMaxPagesAvailable: Longint;
    dwMaxPagesLockable: Longint;
    dwTotalLinearSpace: Longint;
    dwTotalUnlockedPages: Longint;
    dwFreePages: Longint;
    dwTotalPages: Longint;
    dwFreeLinearSpace: Longint;
    dwSwapFilePages: Longint;
    wPageSize: Word;
  end;

For more info, consult the WINAPI.HLP file.

Stuart.
0
 

Author Comment

by:qwalker
ID: 1361164
Thank You
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question