Solved

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

Posted on 2003-11-25
4
899 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
Comment Utility
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
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now