Solved

How much RAM?

Posted on 1998-04-01
4
142 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
Comment Utility
procedure TForm1.Button1Click(Sender: TObject);
var   MS: TMemoryStatus;
begin
  GlobalMemoryStatus(MS);
  Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024);
end;

0
 

Author Comment

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

Accepted Solution

by:
Stuart_Johnson earned 20 total points
Comment Utility
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
Comment Utility
Thank You
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now