Solved

How much RAM?

Posted on 1998-04-01
4
148 Views
Last Modified: 2010-04-06
How can I detect how much RAM a user has in their PC?
0
Comment
Question by:qwalker
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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