![]() |
Durée d'exécution de Windows
J'aurais besoin pour un de mes programmes de récupérer soit la durée d'exécution de Windows, soit son timestamp de démarrage. Je sais que ces informations sont accessibles, mais je n'ai trouvé nulle part comment les utiliser (ni dans la doc de Delphi, ni dans la doc MSDN).
Si quelqu'un sait comment faire (en Delphi de préférence), je suis très intéressé ... |
Il me semble que ce soit ca pour Delphi :
function UpTime: string; const ticksperday: Integer = 1000 * 60 * 60 * 24; ticksperhour: Integer = 1000 * 60 * 60; ticksperminute: Integer = 1000 * 60; tickspersecond: Integer = 1000; var t: Longword; d, h, m, s: Integer; begin t := GetTickCount; d := t div ticksperday; Dec(t, d * ticksperday); h := t div ticksperhour; Dec(t, h * ticksperhour); m := t div ticksperminute; Dec(t, m * ticksperminute); s := t div tickspersecond; Result := 'Uptime: ' + IntToStr(d) + ' Days ' + IntToStr(h) + ' Hours ' + IntToStr(m) + ' Minutes ' + IntToStr(s) + ' Seconds'; end; Jte promet rien :) ++ |
ouaip. c'est ça ;-) j'avais fini par trouver entre temps dans la doc MSDN : "The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started."
Merci quand même :-) |
surement en retard, mais j'ai pensé a BGINFO disponible sur www.sysinternals.com
qui affiche un tas de choses sur le systeme via le background de votre bureau.... |
All times are GMT +2. The time now is 13:36. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.