Click here to Skip to main content
Click here to Skip to main content

How to get a list of installed applications

, 20 Apr 2004
Rate this:
Please Sign up or sign in to vote.
Duplicate the list seen in the Add/Remove Programs Control Panel applet.

Sample screenshot


Recently, I answered a question in the Visual C++ Forum concerning how you would duplicate the list of installed programs seen when you select Add/Remove Programs in Control Panel, and I thought the solution would make a nice (if basic) article.

To fetch the list is very easy - first you need to open the following registry key:


Then simply enumerate all the entries and fetch the DisplayName value from each one.


In order to cater for all tastes, I have included versions of my code for the following environments:

  • MFC
  • WTL
  • ATL7 (included with Visual Studio 2002/2003)

The differences between the MFC and WTL versions are subtle - the MFC version stores the list of programs in a CStringArray and the WTL version uses a CSimpleArray<CString>.

The ATL7 version makes use the of the handy CRegKey class.

Using the CInstalledSoftware Class

To use this class, simply declare an instance of the CInstalledSoftware class in your application, and the constructor will fill the public m_aPrograms member with the list of installed programs. For example, to fill an MFC listbox, you may have code like this:

CInstalledSoftware apps;
for (int i = 0; i < apps.m_aPrograms.GetCount(); i++)

That's it! Rocket science it ain't!

Building the List - MFC/WTL

The MFC/WTL versions of the code build the list using Win32 registry calls:

void BuildList(void)
  HKEY hKey;

  DWORD dwIndex = 0;
  LONG lRet;
  DWORD cbName = IS_KEY_LEN;
  TCHAR szSubKeyName[IS_KEY_LEN];

  while ((lRet = ::RegEnumKeyEx(hKey, dwIndex, szSubKeyName, &cbName, NULL,
   // Do we have a key to open?
   if (lRet == ERROR_SUCCESS)
    // Open the key and get the value
    HKEY hItem;
    if (::RegOpenKeyEx(hKey, szSubKeyName, 0, KEY_READ, &hItem) != ERROR_SUCCESS)
    // Opened - look for "DisplayName"
    TCHAR szDisplayName[IS_KEY_LEN];
    DWORD dwSize = sizeof(szDisplayName);
    DWORD dwType;

    if (::RegQueryValueEx(hItem, IS_DISPLAY, NULL, &dwType,
     (LPBYTE)&szDisplayName, &dwSize) == ERROR_SUCCESS)
     // Add to the main array
   cbName = IS_KEY_LEN;

The ATL7 version uses the much more readable CRegKey class:

void BuildList(void)
 CRegKey reg;

 DWORD dwIndex = 0;
 TCHAR szSubKeyName[IS_KEY_LEN];
 LONG lRet;

 while ((lRet = reg.EnumKey(dwIndex, szSubKeyName, &cbName)) != ERROR_NO_MORE_ITEMS)
  if (lRet == ERROR_SUCCESS)
   CRegKey regItem;
   if (regItem.Open(reg, szSubKeyName, KEY_READ) == ERROR_SUCCESS)
    // Get the "DisplayName" value
    ULONG ulChars;
    if (regItem.QueryStringValue(IS_DISPLAY, NULL, &ulChars) == ERROR_SUCCESS)
     CString strName;
     regItem.QueryStringValue(IS_DISPLAY, strName.GetBuffer(ulChars), &ulChars);
     // Add to the array
  cbName = IS_KEY_LEN;

OK, this class isn't going to win any prizes, but hopefully others will find it useful. Comments welcome!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Comments and Discussions

QuestionHow to give the access to the particular application PinmemberMember 92748641-Aug-12 18:32 
QuestionRE: How to get list of all d softwares installed in ur pc using a java programing language PinmemberPrakashReddy jalla3-Apr-12 21:57 
Generalu missed some issues ---> Pinmembermr.baby1231-Sep-10 2:30 
GeneralWhich part of Registry to Read? for last time used of a software PinmemberCheng XUAN26-Oct-09 17:41 
GeneralTo do it with program paths Pinmemberdc_200027-Sep-09 12:51 
GeneralC# Version PinmemberBlue36516-Aug-09 1:41 
GeneralWant same for hardware(devices) Pinmemberomkarsomani9-Jul-08 0:55 
QuestionHow can i export the data from the installed_programs_wtl_atl7.exe to a .txt PinmemberMeleneky17-Jul-07 14:19 
QuestionHow to get list of installed software in file using fwrite PinmemberVinamrata16-Jul-07 20:25 
GeneralOnly half works on a non-32-bit OS... Pinmemberetheriau1-May-07 21:16 
GeneralExcellent information PinmemberNetDave26-Apr-07 11:49 
Generalwant know icon of installed program Pinmemberchenxuri6-Jul-06 16:37 
GeneralRe: want know icon of installed program PinmemberNibu babu thomas4-Oct-06 23:56 
GeneralWant to know path of .exe file Pinmemberpitnu3-Dec-05 0:24 
GeneralRe: Want to know path of .exe file Pinmemberhan qiao6-Mar-07 16:56 
GeneralFrequency of Use PinmemberChamank1-Sep-05 1:39 
GeneralProgram full path PinsussMcVitie26-Apr-05 23:06 
QuestionHow to get a list of installed applications Pinmemberkrishnan@fastermail.com23-Sep-04 20:04 
AnswerRe: How to get a list of installed applications PinmvpDavidCrow18-Nov-08 8:50 
GeneralRe: How to get a list of installed applications PinmemberCharles Oppermann4-Aug-11 12:23 
GeneralRe: How to get a list of installed applications PinmemberDavidCrow7-Aug-11 20:06 
QuestionHow to determine whether there is any application exist with a file extension PinmemberKmAshif5-Jun-04 19:10 
AnswerRe: How to determine whether there is any application exist with a file extension PinmemberJonathan Hodgson15-Jun-04 6:21 
GeneralDoesn't handle MSI based Installers Well Pinmemberdbareis30-Apr-04 17:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150224.1 | Last Updated 21 Apr 2004
Article Copyright 2004 by Rob Caldecott
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid