GARANTIR DESCONTO

Fórum Obter algumas informações dos hardwares #258671

16/11/2004

0

Ola preciso das seguinte funções...

* Função para Identificar a Capacidade do HD...
Espaço Livre
Espaço Utilizado
* Placa de Video
* Placa Mãe
* Processador
* Memoria
* Windows
* Relação de Programas, instalados na maquina
* Driver em Gerais...

Se alguem tiver algumas dessas funções me passem....por favor estou precisnado urgentemente....

Ok

Ate Mais



:arrow: [color=red:8ac7eabe08]Título alterado pelo Moderador oTTo. Removido: ´HARDWARE´.[/color:8ac7eabe08]
:idea: [color=blue:8ac7eabe08]Seja mais claro no título.[/color:8ac7eabe08]
:idea: [color=blue:8ac7eabe08][url=http://delphiforum.icft.com.br/forum/viewtopic.php?t=16976]Saiba como obter resposta rápida..[/url][/color:8ac7eabe08]
:idea: [color=blue:8ac7eabe08]Leia sempre [url=http://delphiforum.icft.com.br/forum/viewtopic.php?t=6689]Regras de Conduta.[/url][/color:8ac7eabe08]
:idea: [color=blue:8ac7eabe08]Use sempre o Link [url=http://delphiforum.icft.com.br/forum/search.php][img:8ac7eabe08]http://delphiforum.icft.com.br/forum/templates/subSilver/images/icon_mini_search.gif[/img:8ac7eabe08] Pesquisar[/url] no topo da Página.[/color:8ac7eabe08]
:idea: [color=blue:8ac7eabe08]Evite usar caixa alta nos títulos.[/color:8ac7eabe08]


Eduardo.buffara

Eduardo.buffara

Responder

Posts

17/11/2004

Lucasnishimura

naun estou certo, mas tenhu quase certeza que existem componentes para isso.

De uma olhada na sessao de componentes do site
e tb em www.torry.net :d achu q vai achar


Responder

Gostei + 0

17/11/2004

Reginaldo174

unit Hardware;


interface


uses
Windows, Dialogs, Messages, SysUtils, Classes, Controls, StdCtrls, Graphics,
Printers, shellapi, MMSystem;

function TestaPlaca(Value:integer): Boolean;
function DiscoNoDrive(const drive : char): boolean;
function NumeroSerie(Unidade:PChar):String;
function DetectaDrv(const drive : char): boolean;
function NumeroDeCores : Integer;
function Percentdisk(unidade: byte): Integer;
function IsPrinter : Boolean;
function CorrentPrinter :String;

implementation

Function TestaPlaca(Value:integer): Boolean;
{Testa se existe uma placa de som no seu computador}
begin
if WaveOutGetNumDevs > 0 then
begin
result := True
end
else
begin
Result := False;
end;
end;

function DiscoNoDrive(const drive : char): boolean;
{Detecta se há disco no Drive}
var
DriveNumero : byte;
EMode : word;
begin
result := false;
DriveNumero := ord(Drive);
if DriveNumero >= ord(´a´) then
begin
dec(DriveNumero,$20);
EMode := SetErrorMode(SEM_FAILCRITICALERRORS);
end;
try
if DiskSize(DriveNumero-$40) = -1 then
begin
Result := False;
end
else
begin
Result := True;
end;
Except
SetErrorMode(EMode);
end;
end;

function NumeroSerie(Unidade:PChar):String;
{Retorna o Número serial da unidade especificada}
var
VolName,SysName : AnsiString;
SerialNo,MaxCLength,FileFlags : DWord;
begin
try
SetLength(VolName,255);
SetLength(SysName,255);
GetVolumeInformation(Unidade,PChar(VolName),255,@SerialNo,
MaxCLength,FileFlags,PChar(SysName),255);
result := IntToHex(SerialNo,8);
except
result := ´ ´;
end;
end;

function DetectaDrv(const drive : char): boolean;
{Detecta quantas unidade possui no computador}
var
Letra: string;
begin
Letra := drive + ´:\´;
if GetDriveType(PChar(Letra)) < 2 then
begin
result := False;
end
else
begin
result := True;
end;
end;


function NumeroDeCores : Integer;
{Retorna a quantidade atual de cores no Windows (16, 256, 65536 = 16 ou 24 bit}
var
DC:HDC;
BitsPorPixel: Integer;
begin
Dc := GetDc(0); // 0 = vídeo
BitsPorPixel := GetDeviceCaps(Dc,BitsPixel);
Result := 2 shl (BitsPorPixel - 1);
end;

function Percentdisk(unidade: byte): Integer;
{Retorna a porcentagem de espaço livre em uma unidade de disco}
var
A,B, Percentual : longint;
begin
if DiskFree(Unidade) -1 then
begin
A := DiskFree(Unidade) div 1024;
B := DiskSize(Unidade) div 1024;
Percentual:=(A*100) div B;
result := Percentual;
end
else
begin
result := -1;
end;
end;

function IsPrinter : Boolean;
Const
PrnStInt : Byte = $17;
StRq : Byte = $02;
PrnNum : Word = 0; { 0 para LPT1, 1 para LPT2, etc. }
Var
nResult : byte;
Begin (* IsPrinter*)
Asm
mov ah,StRq;
mov dx,PrnNum;
Int $17;
mov nResult,ah;
end;
IsPrinter := (nResult and $80) = $80;
End;

function CorrentPrinter :String;
// Retorna a impressora padrão do windows
// Requer a unit printers declarada na clausula uses da unit
var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port : array[0..255] of char;
hDMode : THandle;
begin
Printer.GetPrinter(Device, Driver, Port, hDMode);
Result := Device+´ na porta ´+Port;
end;

end.


Responder

Gostei + 0

17/11/2004

Reginaldo174

function CPUSpeed: 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
mov TimerLo, eax
mov TimerHi, edx
end;
Sleep(DelayTime);
asm
dw 310Fh
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;


Responder

Gostei + 0

17/11/2004

Reginaldo174

procedure TForm1.Timer1Timer(Sender: TObject);
const cBytesPorMb=1024*1024;
var
M: TMemoryStatus;
T : string;
begin
M.dwLength:=SizeOf(M);
GlobalMemoryStatus(M);
Memo1.Clear;
with Memo1.Lines do
begin
Add(Format(´Memória em uso: ¬d¬¬´, [M.dwMemoryLoad]));
Add(Format(´Total de física: ¬f MB´, [M.dwTotalPhys/cBytesPorMB]));
Add(Format(´Total máx. paginação: ¬f MB´, [M.dwTotalPageFile/ cBytesPorMB]));
Add(Format(´Paginação disponível: ¬f MB´, [M.dwAvailPageFile/ cBytesPorMB]));
Add(Format(´Total vitual: ¬fMB´, [M.dwTotalVirtual/cBytesPorMB]));
Add(Format(´Virtual disponível: ¬fMB´, [M.dwAvailVirtual/cBytesPorMB]));
T := formatfloat(´#,´,(diskfree(0)));
Add(´Espaço Livre do HD: ´+ copy(T,1,4)+´ MB´);
T:= formatfloat(´,´,(DiskSize(0)));
Add(´Tamanho do HD: ´+copy(T,1,4)+´ MB´) ;

end;

end;


Responder

Gostei + 0

17/11/2004

Massuda

O [url=http://www.mitec.cz/]MiTeC System Information Component (MSIC)[/url] faz isso; conforme o site:
Standalone components[list:f207fab708][*:f207fab708]TMSystemInfo - contains MSIC[*:f207fab708]TCPUUsage - contains component for CPU usage evaluating[/list:u:f207fab708]Units [list:f207fab708][*:f207fab708]Windows enumeration[*:f207fab708]Services enumeration (NT only)[*:f207fab708]Drivers enumeration (NT only)[*:f207fab708]Local and global users and groups enumeration (NT only)[*:f207fab708]Event log enumeration (NT only)[*:f207fab708]Shares, sessions and open files enumeration[*:f207fab708]Scheduled tasks enumeration (NT only)[*:f207fab708]NetBIOS API[*:f207fab708]Journal implementation unit[/list:u:f207fab708]



Responder

Gostei + 0

27/09/2007

Nightshade

é shareware esse componente?


Responder

Gostei + 0

28/09/2007

Paulo Samurai

Se voce ja tiver instalada a jediVCL 3.x, há alguns componentes que extraem uma boa quantidade de informações como o TJvComputerInfoEx

[]´s


Responder

Gostei + 0

28/09/2007

Nightshade

Ele da possibilidade de passar pra um TStringList os valores capturados?
preciso q faça isso..


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar