Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
A method for retrieving a list of installed applications on a particular machine Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
30-Dec-03
Category
Win API
Language
Delphi 5.x
Views
225
User Rating
7
# Votes
1
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Michael Britt 

Here is a method for retrieving a list of installed applications on a particular 
machine running a Windows OS.

Answer:

Start up Delphi. 
Select File | New Application. 
Add Registry to the uses of your new Unit. 
Place a TListBox (ListBox1) component on your form.
Place a TButton (Button1) in your form. 
Place the following code in the OnClick event of the Button1: 

1   procedure TForm1.Button1Click(Sender: TObject);
2   const
3     REGKEYAPPS = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall';
4   
5   var
6     reg: TRegistry;
7     List1: TStringList;
8     List2: TStringList;
9     j, n: integer;
10  
11  begin
12    reg := TRegistry.Create;
13    List1 := TStringList.Create;
14    List2 := TStringList.Create;
15  
16    {Load all the subkeys}
17    with reg do
18    begin
19      RootKey := HKEY_LOCAL_MACHINE;
20      OpenKey(REGKEYAPPS, false);
21      GetKeyNames(List1);
22    end;
23    {Load all the Value Names}
24    for j := 0 to List1.Count - 1 do
25    begin
26      reg.OpenKey(REGKEYAPPS + '' + List1.Strings[j], false);
27      reg.GetValueNames(List2);
28  
29      {We will show only if there is 'DisplayName'}
30      n := List2.IndexOf('DisplayName');
31      if (n <> -1) and
32        (List2.IndexOf('UninstallString') <> -1) then
33      begin
34        ListBox1.Items.Add(
35          (reg.ReadString(List2.Strings[n])));
36      end;
37    end;
38    List1.Free;
39    List2.Free;
40    reg.CloseKey;
41    reg.Destroy;
42  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC