title: Get Icon from UWP App
body: <p>I want to extract the icon of an UWP App to build a Explorer like "Open With" menue.</p>
  
  <p>With the help of <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762109(v=vs.85).aspx" rel="noreferrer">SHAssocEnumHandlers</a> i managed to get the associated applications to a given file extension. </p>
  
  <p>With <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb776317(v=vs.85).aspx" rel="noreferrer">IAssocHandler::GetIconLocation</a> i get for UWP Apps (Microsoft Edge) something like:</p>
  
  <blockquote>
    <p>@{Microsoft.MicrosoftEdge_41.16299.371.0_neutral__8wekyb3d8bbwe?ms-resource://Microsoft.MicrosoftEdge/Files/Assets/MicrosoftEdgeSquare44x44.png}</p>
  </blockquote>
  
  <p>If i use <a href="https://msdn.microsoft.com/de-de/library/windows/desktop/bb759919(v=vs.85).aspx" rel="noreferrer">SHLoadIndirectString</a> on this string i get:</p>
  
  <blockquote>
    <p>C:\WINDOWS\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Assets\MicrosoftEdgeSquare44x44.scale-100.png</p>
  </blockquote>
  
  <p>But that is the wrong Icon (has no color or contrast).  </p>
  
  <p>In the directory: </p>
  
  <blockquote>
    <p>C:\WINDOWS\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Assets\</p>
  </blockquote>
  
  <p>Are a lot of different Images. 
  I don't understand how to choose the correct icon. </p>
  
  <p>I tried to look up the "AppxManifest.xml" but i looks completly different for different Apps.</p>
  
  <p>For an non UWP App i get  as IconLocation something like:</p>
  
  <blockquote>
    <p>C:\WINDOWS\system32\NOTEPAD.EXE</p>
  </blockquote>
  
  <p>Then i can use:</p>
  
  <pre><code>Icon.ExtractAssociatedIcon()
  </code></pre>
  
  <p>and everything is fine. I didn't finde any way to do the same with an UWP App.</p>