Fórum Memoria, processador ... #231084
10/05/2004
0
Alguem tem alguma classe, componente ou algum programa com fonte que obtenha dados da maquina, como processador, memoria, versao do windows? Parecido com o AIDA.
Rafael Colucci
Colutti
Curtir tópico
+ 0Posts
10/05/2004
Cebikyn
http://www.swissdelphicenter.ch/en/showcode.php?id=2044
Memória RAM total e disponível:
http://www.swissdelphicenter.ch/en/showcode.php?id=94
Versão do WIndows:
http://www.swissdelphicenter.ch/en/showcode.php?id=1126
Se precisar ainda mais, o site indicado ofere um recurso de pesquisa, em que vc pode obter muito mais códigos fonte interessantes.
Gostei + 0
10/05/2004
Colutti
porem com esta funcao eu nao sei qual a velocidade do processador ... os dados aparecem muito em baixo nivel ...
Rafael
Gostei + 0
11/05/2004
Cebikyn
uses Registry; function GetCpuSpeed: string; var Reg: TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKey(´Hardware\Description\System\CentralProcessor\0´, False) then begin Result := IntToStr(Reg.ReadInteger(´~MHz´)) + ´ MHz´; Reg.CloseKey; end; finally Reg.Free; end; end;
Eu tinha uma em assembler que pega a velocidade real, mas tá em casa...
Gostei + 0
11/05/2004
Colutti
esta funcao ate funciona, porem so no windows 2000 pra cima. no windows 98 e 95 nao existe esta chave no registro.
Rafael
Gostei + 0
20/05/2004
Cebikyn
function GetCPUSpeed: Double; const DelayTime = 500; var TimerHi, TimerLo: DWORD; PriorityClass, Priority: Integer; begin PriorityClass := GetPriorityClass(GetCurrentProcess); Priority := GetThreadPriority(GetCurrentThread); SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL); Sleep(10); asm dw 310Fh // rdtsc mov TimerLo, eax mov TimerHi, edx end; Sleep(DelayTime); asm dw 310Fh // rdtsc sub eax, TimerLo sbb edx, TimerHi mov TimerLo, eax mov TimerHi, edx end; SetThreadPriority(GetCurrentThread, Priority); SetPriorityClass(GetCurrentProcess, PriorityClass); Result := TimerLo / (1000.0 * DelayTime); end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)