//나름데로 여기저기 물어보면서 비베소스를 델파이로 바꿨는데 실행이 안되요..
procedure TfrmMain.ScanPC_GetSwrINFO;
var
GetRegValue: String;
IRETVAL: Integer;
IRETVAL2: Integer;
PHKey: HKEY;
PHKey2: HKEY;
vValue: String;
sz: PDWORD;
fKeyIndex: Cardinal;
fKeyName: String;
fKeyLen: Cardinal;
fClassName: String;
fClassLen: PDWORD;
fLastWrite: PFileTime;
dwType: PDWORD;
begin
GetRegValue := '';
IRETVAL := regOpenKeyEx(HKEY_LOCAL_MACHINE, 'SOFTWAREMICROSOFTWINDOWSCURRENTVERSIONUNINSTALL', 0, KEY_ENUMERATE_SUB_KEYS, PHKey);
fKeyIndex := 0;
while (IRETVAL <> 0) do
begin
SetString(fKeyName, nil, 255);
SetString(fClassName, nil, 255);
fKeyLen := 255;
fClassLen^ := 255;
IRETVAL := regEnumKeyEx(PHKey, fKeyIndex, PChar(fKeyName), fKeyLen, nil, PChar(fClassName), fClassLen, fLastWrite);
if IRETVAL <> 0 then
begin
fKeyName :=copy(fKeyName,1,fKeyLen);
fClassName :=copy(fClassName,1,fClassLen^);
sz^ := 256;
SetString(vValue, nil, 256);
IRETVAL2 := RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar('SOFTWAREMICROSOFTWINDOWSCURRENTVERSIONUNINSTALL' + fKeyName), 0, KEY_ALL_ACCESS, PHKey2);
IRETVAL2 := RegQueryValueEx(PHKey2, 'DisplayName', 0, dwType, PByte(vValue), sz);
if IRETVAL2 = 0 Then
begin
GetRegValue := copy(vValue,1, sz^ - 1);
listHw.Items.Add(vValue);
end;
RegCloseKey (PHKey2);
end;
fKeyIndex := fKeyIndex + 1;
end;
RegCloseKey (PHKey);
end;
var
GetRegValue: String;
IRETVAL: Integer;
IRETVAL2: Integer;
PHKey: HKEY;
PHKey2: HKEY;
vValue: String;
sz: Cardinal;
fKeyIndex: Cardinal;
fKeyName: String;
fKeyLen: Cardinal;
dwType: Cardinal;
begin
GetRegValue := '';
IRETVAL := regOpenKeyEx(HKEY_LOCAL_MACHINE, 'SOFTWAREMICROSOFTWINDOWSCURRENTVERSIONUNINSTALL', 0, KEY_ENUMERATE_SUB_KEYS, PHKey);
fKeyIndex := 0;
while (IRETVAL = 0) do
begin
SetString(fKeyName, nil, 255);
fKeyLen := 255;
IRETVAL := regEnumKeyEx(PHKey, fKeyIndex, PChar(fKeyName), fKeyLen, nil, nil, nil, nil);
if IRETVAL = 0 then
begin
fKeyName :=copy(fKeyName,1,fKeyLen);
SetString(vValue, nil, 255);
sz := 255;
IRETVAL2 := RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar('SOFTWAREMICROSOFTWINDOWSCURRENTVERSIONUNINSTALL' + fKeyName), 0, KEY_ALL_ACCESS, PHKey2);
IRETVAL2 := RegQueryValueEx(PHKey2, PChar('DisplayName'), nil, @dwType,PByte(vValue),@sz);
if IRETVAL2 = 0 Then
begin
ListSw.Items.Add(vValue);
end;
RegCloseKey (PHKey2);
end;
fKeyIndex := fKeyIndex + 1;
end;
RegCloseKey (PHKey);
end;