Solved

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

Posted on 2003-11-25
4
908 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

910 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

23 Experts available now in Live!

Get 1:1 Help Now