?
Solved

How much RAM?

Posted on 1998-04-01
4
Medium Priority
?
161 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 80 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

762 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