I want to extract the icon of an UWP App to build a Explorer like "Open With" menue.
With the help of SHAssocEnumHandlers i managed to get the associated applications to a given file extension.
With IAssocHandler::GetIconLocation i get for UWP Apps (Microsoft Edge) something like:
@{Microsoft.MicrosoftEdge_41.16299.371.0_neutral__8wekyb3d8bbwe?ms-resource://Microsoft.MicrosoftEdge/Files/Assets/MicrosoftEdgeSquare44x44.png}
If i use SHLoadIndirectString on this string i get:
C:\WINDOWS\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Assets\MicrosoftEdgeSquare44x44.scale-100.png
But that is the wrong Icon (has no color or contrast).
In the directory:
C:\WINDOWS\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Assets\
Are a lot of different Images. I don't understand how to choose the correct icon.
I tried to look up the "AppxManifest.xml" but i looks completly different for different Apps.
For an non UWP App i get as IconLocation something like:
C:\WINDOWS\system32\NOTEPAD.EXE
Then i can use:
Icon.ExtractAssociatedIcon()
and everything is fine. I didn't finde any way to do the same with an UWP App.