Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-11-25
4
Medium Priority
?
947 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 500 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

926 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