Solved

Find the Path and Version of Applications which installed in Window2000 by using Visual C++

Posted on 2003-11-25
4
926 Views
Last Modified: 2010-04-01
Dear all,

Can you help me to find the Path and Version of all Applications which installed in Window2000 by using Visual C++?

I mean applications that you can see them in Add/Remove Programs Control Panel.

Thanks in advance !

DungNgo.
0
Comment
Question by:dungngo
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 9816767
This is not a C++ language question and it off topic here.  A much better place for this would be the WINDOWS PROGRAMMING topic area:

http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/

You should post a comment for the moderator in the CS topic area:

http://www.experts-exchange.com/Community_Support/

and ask them to move your question to the right topic area.  It helps things all around and benefits you by getting Windows Programming experts on your question vs. C++ experts here.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 125 total points
ID: 9816811
You'll find the programs  in the Windows registry

       HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Any subkey represents

You may open the key using RegOpenKeyEx, e. g.


    HKEY  hkeyTop   = HKEY_LOCAL_MACHINE;
    HKEY  hkey      = NULL;
    long  rc        = 0L;
   

    if ((rc = RegOpenKeyEx(hkeyTop,
                "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", 0, KEY_READ, hkey))
          != ERROR_SUCCESS)
    {
        cout << "key SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall was not found. rc= " << rc << "\n";
        return 2;
    }

Then you might query for all subkeys using RegEnumKey

   char  szSubKey[512] = { '\0' };
   DWORD dwSize = 512;
   DWORD  dwIdx = 0; // index of subkey to enumerate
   while ((rc = RegEnumKey(hkey, dwIdx, szSubKey, &dwSize)
          == ERROR_SUCCESS)
    {
          dwIdx++;
          // do something with szSubKey
          ....
    }

Hope, that helps

Alex

0
 
LVL 9

Expert Comment

by:tinchos
ID: 10285819
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: itsmeandnobodyelse {http:#9816811}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question