Source:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses Registry;
procedure TForm1.Button1Click(Sender: TObject);
var
MyList: TStringList;
MyRegistry: TRegistry;
i: Integer;
Str: string;
begin
MyRegistry:=TRegistry.Create;
MyList:=TStringList.Create;
with MyRegistry do
begin
RootKey:=HKEY_LOCAL_MACHINE;
if OpenKey('Software\Microsoft\Windows\CurrentVersion\Uninstall', False)=True then
GetKeyNames(MyList);
CloseKey;
for i:=0 to MyList.Count-1 do
begin
RootKey:=HKEY_LOCAL_MACHINE;
OpenKey('Software\Microsoft\Windows\CurrentVersion\Uninstall\'+MyList[i], False);
Str:=ReadString('DisplayName');
if Str<>'' then
Memo1.Lines.Add(ReadString('DisplayName'));
CloseKey;
end;
end;
end;
end.
Bentuk Form:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment