How to get installed applicatio path for executbale in COM

Viewed 170

I am trying to get installed location of all application using COM. I am able to get the display name of each application. But I am not able to get installed path of each application.

MY Code:

CComPtr<IShellItem> spPrinters;
        CoInitialize(nullptr);
        HRESULT hresult = ::SHCreateItemFromParsingName(L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\8\\"
            L"::{7B81BE6A-CE2B-4676-A29E-EB907A5126C5}", nullptr, IID_PPV_ARGS(&spPrinters));
        CComPtr<IEnumShellItems> spEnum;
        spPrinters->BindToHandler(nullptr, BHID_EnumItems, IID_PPV_ARGS(&spEnum));
        for (CComPtr<IShellItem> spProgram; spEnum->Next(1, &spProgram, nullptr) == S_OK; spProgram.Release())
        {
            CComHeapPtr<wchar_t> spszName;
            spProgram->GetDisplayName(SIGDN_NORMALDISPLAY, &spszName);
            CString cDisplayName = spszName;
}

Any idea how to get installed path from IEnumShellItems.

Thanks in adv.

1 Answers
Related