Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi CPU- und RAM Auslastung auch unter win 9x? (https://www.delphipraxis.net/6761-cpu-und-ram-auslastung-auch-unter-win-9x.html)

Alexander 21. Jul 2003 15:37


CPU- und RAM Auslastung auch unter win 9x?
 
Hi,
habe jetzt schon einigen Source gefunden wie man die Auslastung von RAM und CPU unter NT ff ausliest. Aber wie geht das unter 9x und unter NTff?
Wäre nett, wenn mir wer weiterhelfen könnte.
Alexander

Luckie 21. Jul 2003 15:40

Re: CPU- und RAM Auslastung auch unter win 9x?
 
Für den Speicher nimm TMemoryStatus und die CPU-Auslastung bekommst du unter win9x nicht, da dies nicht unterstützt wird.

Alexander 21. Jul 2003 15:50

Re: CPU- und RAM Auslastung auch unter win 9x?
 
Werde ich mir ankucken...
Aber Speircherauslastung funktioniert unter 9x?

Pseudemys Nelsoni 27. Jul 2003 17:10

Re: CPU- und RAM Auslastung auch unter win 9x?
 
Zitat:

The MEMORYSTATUS structure contains information about current memory availability. The GlobalMemoryStatus function uses this structure.

typedef struct _MEMORYSTATUS { // mst
DWORD dwLength; // sizeof(MEMORYSTATUS)
DWORD dwMemoryLoad; // percent of memory in use
DWORD dwTotalPhys; // bytes of physical memory
DWORD dwAvailPhys; // free physical memory bytes
DWORD dwTotalPageFile; // bytes of paging file
DWORD dwAvailPageFile; // free bytes of paging file
DWORD dwTotalVirtual; // user bytes of address space
DWORD dwAvailVirtual; // free user bytes

} MEMORYSTATUS, *LPMEMORYSTATUS;


Members

dwLength

Indicates the size of the structure. The calling process should set this member prior to calling GlobalMemoryStatus.

dwMemoryLoad

Specifies a number between 0 and 100 that gives a general idea of current memory utilization, in which 0 indicates no memory use and 100 indicates full memory use.

dwTotalPhys

Indicates the total number of bytes of physical memory.

dwAvailPhys

Indicates the number of bytes of physical memory available.

dwTotalPageFile

Indicates the total number of bytes that can be stored in the paging file. Note that this number does not represent the actual physical size of the paging file on disk.

dwAvailPageFile

Indicates the number of bytes available in the paging file.

dwTotalVirtual

Indicates the total number of bytes that can be described in the user mode portion of the virtual address space of the calling process.

dwAvailVirtual

Indicates the number of bytes of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling process.



See Also

GlobalMemoryStatus
das hab ich in der windows SDK gefunden...aber wie setz ich das ein? sowas (für mich) schweres hab ich noch nie gemacht...z.b soll "dwMemoryLoad" ja die % zahl die vom speicher in benutzung ist enthalten...aber wie krieg ich das z.b in eine caption? das es mit "label1.caption := dwMemoryLoad" geht ist mir schon klar (leider) (zumal er bei mir sogar sagt das "dwMemoryLoad" unbekannt ist

mirage228 27. Jul 2003 17:15

Re: CPU- und RAM Auslastung auch unter win 9x?
 
var
MS: TMemoryStatus;
begin
try
GlobalMemoryStatus(MS);
Memory.Caption := 'Verfügbarer physikalischer Speicher: '+FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024);
UsedMem.Caption := 'Speicher in Benutzung: '+Format('%d %%', [MS.dwMemoryLoad]);
finally
end;
end;


;-)

Pseudemys Nelsoni 27. Jul 2003 17:21

Re: CPU- und RAM Auslastung auch unter win 9x?
 
hoi

danke, das funzt super :)

kannst du mir noch sagen wie diese zeile funzt?...

Delphi-Quellcode:
UsedMem.Caption := 'Speicher in Benutzung: '+Format('%d %%', [MS.dwMemoryLoad]);
was ist %d % % etc?

wenn man es in einaer statusbar hätte, müsste man es mit einem timer immer aktualisieren?

mirage228 27. Jul 2003 17:27

Re: CPU- und RAM Auslastung auch unter win 9x?
 
Zitat:

Zitat von silent
hoi

danke, das funzt super :)

kannst du mir noch sagen wie diese zeile funzt?...

Delphi-Quellcode:
UsedMem.Caption := 'Speicher in Benutzung: '+Format('%d %%', [MS.dwMemoryLoad]);
was ist %d % % etc?

wenn man es in einaer statusbar hätte, müsste man es mit einem timer immer aktualisieren?

%d ist für Integer/Zahl und die "%%" stehen für ein "%"!

mfG
mirage228

Pseudemys Nelsoni 27. Jul 2003 17:34

Re: CPU- und RAM Auslastung auch unter win 9x?
 
danke ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz