Retrieve list of installed applications. Windows CE / Windows Mobile C / C++

I want to programmatically retrieve a list of ALL installed applications. The same type of list that is displayed when one taps on 'Programs' from the Start list of a windows mobile device. I would like some code examples to accomplish this.

Thanks
atomicgs12Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dennis AriesCEO @ Arkro ITCommented:
You should check the registry, specificly SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
That section contais most of the program-information you are looking for.
Are you looking for c++ or for c#-code?
I've attached samples for reading the registry for both.

/* C++ */
#include "windows.h"
#include <winreg.h>
#include <stdio.h>

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    HKEY keyHandle;
    char rgValue [1024];
    char fnlRes [1024];
    DWORD size1;
    DWORD Type;

        if( RegOpenKeyEx(    HKEY_LOCAL_MACHINE, 
            "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",0, 
            KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
             {
                size1=1023;
                RegQueryValueEx( keyHandle, "Productid", NULL, &Type, 
                    (LPBYTE)rgValue,&size1);
                sprintf(fnlRes,"Product ID of your Windows system is:: %s",rgValue);
             }     
        else strcpy(fnlRes,"Couldn't access system information!");
    
            RegCloseKey(keyHandle);

MessageBox(NULL, fnlRes, "Product ID of Windows", MB_SYSTEMMODAL|MB_ICONINFORMATION);

return 0;
} 

/* C# */
public string Read(string KeyName)
{
    // Opening the registry key
    RegistryKey rk = baseRegistryKey ;
    // Open a subKey as read-only
    RegistryKey sk1 = rk.OpenSubKey(subKey);
    // If the RegistrySubKey doesn't exist -> (null)
    if ( sk1 == null )
    {
        return null;
    }
    else
    {
        try 
        {
            // If the RegistryKey exists I get its value
            // or null is returned.
            return (string)sk1.GetValue(KeyName.ToUpper());
        }
        catch (Exception e)
        {
            // ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
            return null;
        }
    }
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
atomicgs12Author Commented:
This is not what I am looking for. If you look at the list of applications under the SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall key you will note they do not match or contain all the programs that are listed under Start/Programs from the desktop page of ANY device. Please read my entire question more carefully.
0
pgnatyukCommented:
You cannot uninstall all programs. You can uninstall only the programs that you installed - the applications that are not a part of the ROM. You cannot uninstall the ROM application, you cannot delete it.
Other application are listed in the registry as it was shown for you already.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

atomicgs12Author Commented:
My be I worded my question wrong or every one is interpeting my question different than I am. I am looking for a way to retrieve all applications that are on the device. Those that can be uninstalled and those applications which are not uninstallable. ALL APPLICATIONS on the device. Install/uninstall has nothing to do with my request.
0
pgnatyukCommented:
All application icons you see in the Programs are simply shortcuts (links) that are located in a folder on your device. Actually, the file names are the applications you need. These files are text files and you can read them if you need.

On my phone the folder is "\\Windows\Start Menu\Programs".


0
atomicgs12Author Commented:
After thinking about some more actually I'll just run through all directories and look for all .exe files. That way I'll have a list of all executable type apps that are on the device. Thanks for your help. I'll split the points between all those who helped
0
atomicgs12Author Commented:
After thinking about some more actually I'll just run through all directories and look for all .exe files. That way I'll have a list of all executable type apps that are on the device. Thanks for your help. I'll split the points between all those who helped
0
pgnatyukCommented:
Thanks.
One more comment about your idea - you will find a lot of executable files with very strange names and unknown purpose that are never shown in the Start menu. On Windows CE device you can find a lot of "debug" applications - probably the dev team left these apps on the device.
0
atomicgs12Author Commented:
Again thanks I appreciate your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Smartphone Programming

From novice to tech pro — start learning today.