function ReadMultirowKey(reg: TRegistry; Key: string): TStrings;
const
bufsize = 100;
var
i: integer;
s1: string;
sl: TStringList;
bin: array[1..bufsize] of char;
begin
try
result := nil;
sl := nil;
sl := TStringList.Create;
if not Assigned(reg) then
raise Exception.Create('TRegistry object not assigned.');
FillChar(bin, bufsize, #0);
reg.ReadBinaryData(Key, bin, bufsize);
i := 1;
s1 := '';
while i < bufsize do
begin
if ord(bin[i]) >= 32 then
s1 := s1 + bin[i]
else
begin
if Length(s1) > 0 then
begin
sl.Add(s1);
s1 := '';
end;
end;
inc(i);
end;
result := sl;
except
sl.Free;
raise;
end;
end;
type
TWinVersion = (wvUnknown, wv95, wv98, wvME, wvNT3, wvNT4, wvW2K, wvXP);
function DetectWinVersion: TWinVersion;
var
OSVersionInfo: TOSVersionInfo;
begin
Result := wvUnknown;
OSVersionInfo.dwOSVersionInfoSize := sizeof(TOSVersionInfo);
if GetVersionEx(OSVersionInfo) then
begin
case OSVersionInfo.DwMajorVersion of
3: Result := wvNT3;
4: case OSVersionInfo.DwMinorVersion of
0: if OSVersionInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
Result := wvNT4
else
Result := wv95;
10: Result := wv98;
90: Result := wvME;
end;
5: case OSVersionInfo.DwMinorVersion of
0: Result := wvW2K;
1: Result := wvXP;
end;
end;
end;
end;
function DetectWinVersionStr: string;
const
VersStr: array[TWinVersion] of string = (
'Unknown',
'Windows 95',
'Windows 98',
'Windows ME',
'Windows NT 3',
'Windows NT 4',
'Windows 2000',
'Windows XP');
begin
Result := VersStr[DetectWinVersion];
end;
procedure TForm2.PDJXPSpeedButton20Click(Sender: TObject);
function GetCPUSpeed: double;
const
DelayTime = 250;
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;
var
Registryv: TRegistry;
RegPath: string;
sl: TStrings;
lpDisplayDevice: TDisplayDevice;
dwFlags: DWORD;
cc:DWORD;
cpu1,cpu2,cpu3,Cname:string;
reg:treginifile;
h,w,memoryexit,memorypodexit:integer;
begin
GetMemory;
form2.PDJXPMemo1.Clear;
form2.PDJXPMemo1.Lines.Add('---BIOS');
RegPath := '\HARDWARE\DESCRIPTION\System';
registryv := tregistry.Create;
registryv.rootkey := HKEY_LOCAL_MACHINE;
sl := nil;
try
registryv.Openkey(RegPath, false);
form2.PDJXPMemo1.Lines.Add(' -Data '+RegistryV.ReadString('SystemBiosDate'));
sl := ReadMultirowKey(RegistryV, 'SystemBiosVersion');
form2.PDJXPMemo1.Lines.Add(' -Version '+sl.Strings[0]+' '+sl.Strings[1]);
form2.PDJXPMemo1.Lines.Add('');
except
end;
Registryv.Free;
if Assigned(sl) then
sl.Free;
lpDisplayDevice.cb := sizeof(lpDisplayDevice);
dwFlags := 0;
cc := 0;
form2.PDJXPMemo1.lines.add('---Video');
EnumDisplayDevices(nil, 0, lpDisplayDevice, 0);
begin
Inc(cc);
form2.PDJXPMemo1.lines.add(' -'+lpDisplayDevice.DeviceString);
h:=screen.Height;
w:=screen.Width;
form2.PDJXPMemo1.lines.add(' -Oaeouaa ?ac?auaiea '+inttostr(w)+' x '+inttostr(h));
form2.PDJXPMemo1.Lines.Add('');
end;
begin
form2.PDJXPMemo1.lines.add('---System');
form2.PDJXPMemo1.lines.add(' -'+DetectWinVersionStr);
form2.PDJXPMemo1.Lines.Add('');
reg:=treginifile.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKeyreadonly('\HARDWARE\DESCRIPTION\System\CentralProcessor');
cpu1:=reg.readString('0','ProcessorNameString','Ia ii?aaaeaii...');
cpu2:=reg.readString('0','Identifier','Ia ii?aaaeaii...');
cpu3:=reg.readString('0','VendorIdentifier','Ia ii?aaaeaii...');
reg.CloseKey;
reg.Free;
form2.PDJXPMemo1.lines.add('---CPU');
form2.PDJXPMemo1.lines.add(' -'+cpu1);
form2.PDJXPMemo1.lines.add(' -'+cpu2);
form2.PDJXPMemo1.lines.add(' -'+cpu3);
form2.PDJXPMemo1.lines.add(' -Oaeouay ?anoioa CPU '+Format(' %f',[GetCPUSpeed]));
form2.PDJXPMemo1.Lines.Add('');
reg:=treginifile.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKeyreadonly('\SYSTEM\ControlSet001\Control\ComputerName');
Cname:=reg.readString('ActiveComputerName','ComputerName','Ia ii?aaaeaii...');
reg.CloseKey;
reg.Free;
form2.PDJXPMemo1.lines.add('---Active Name Computer');
form2.PDJXPMemo1.lines.add(' -'+Cname);
form2.PDJXPMemo1.Lines.Add('');
memoryexit:=round(strtoint(memory)/1024);
memorypodexit:=round(strtoint(memorypod)/1024);
form2.PDJXPMemo1.lines.add('---Memory');
form2.PDJXPMemo1.lines.add(' -DDR\DIMM '+inttostr(memoryexit)+' MB');
form2.PDJXPMemo1.lines.add(' -Oaee iiaea?ee '+inttostr(memorypodexit)+' MB');
form2.PDJXPMemo1.Lines.Add('');
end;
end;