![]() |
Auslastung in Progressbar/gauge
Hallo :) liebe user
1) Ich habe folgendes Problem und zwar habe ich bis jetzt so gemacht das meine RAM(Speicher)auslastung in einer Progressbar angezeigt wird. Ich brauche dafür nur einen Timer und eine Progressbar
Delphi-Quellcode:
Das kommt natürlich alles in den timer.
procedure TForm1.Timer2Timer(Sender: TObject);
var x, y : real; memory: TMemoryStatus; Auslastung: integer; begin memory.dwLength := SizeOf(memory); GlobalMemoryStatus(memory); x := memory.dwTotalPhys - memory.dwAvailPhys; y := memory.dwTotalPhys; Auslastung := round(((x/y)*100)); progressbar1.Position := Auslastung; end; Ist es möglich diesen wert in eine gauge umzuschreiben? 2) Gibts auch eine möglichkeit die CPU auslastung auszulesen ? |
Re: Auslastung in Progressbar/gauge
1.) Ja. Nimm einfach eein Gauge.
2.) Ja. Benutz dazu bitte die Forensuche. 3.) Bitte erstell in Zukunft für eine neue Frage auch einen neuen Thread. Danke. |
Re: Auslastung in Progressbar/gauge
Du schreibst einfach statt
Delphi-Quellcode:
Progressbar1.Position
Delphi-Quellcode:
Falls die Auslastung ein Integer zwischen 0 und 100 ist ists doch Ideal und einfach.
Gauge1.Progress
|
Re: Auslastung in Progressbar/gauge
Zitat:
Ich habe leider nix passendes gefunden. zu 1) Wenn ich progressbar1.position mit gauge1.position tausche kommt ne fehlermeldung zur 3) Es gibt viele threads wo nebenbei eine zweite zum passenden thema frage gestellt wird. \\ edit: danke an Neutral General |
Re: Auslastung in Progressbar/gauge
Zitat:
![]() Zitat:
|
Re: Auslastung in Progressbar/gauge
Bitteschön:
Delphi-Quellcode:
Das sollte so funktionieren ...
procedure TForm1.Timer2Timer(Sender: TObject);
var x, y : real; memory: TMemoryStatus; Auslastung: integer; begin memory.dwLength := SizeOf(memory); GlobalMemoryStatus(memory); x := memory.dwTotalPhys - memory.dwAvailPhys; y := memory.dwTotalPhys; Auslastung := round(((x/y)*100)); // Memmory Gauge1.Progress := Auslastung; // CPU Gauge2.Progress := GetCPUUsage; end; GetCPUUsage gibt es bei den ![]() Oder: ![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:59 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