title: c++ retrieve executable`s icon for use in windows registry icon path?
body: <p>I am trying to set a value in windows registry of my application.
  The executable path works fine by just adding the path but when i load it the icon of this application cannot be seen in windows programs.
  How can i retrieve correctly the icon from my application and use it as icon path in the registry ?</p>
  
  <p>Do i need to set something inside my application so the registry can see the icon ?</p>
  
  <p>key reg for shell-open-command "C:\myapp\test.exe" "%1"
  but for the key reg Default Icon "" do i need to use a regural .ico file near the exe or could i get also from the executable`s .exe file the ico i use from inside the application ?</p>
  
  <p>I would like to avoid using .ico file so if it can be done by taking the executable`s file icon would be nice.</p>
  
  <p>A good example to understand cause its not a duplicate is the torrent magnet links.</p>
  
  <p>Check magnet->shell->open->command</p>
  
  <p>and magnet->DefaultIcon</p>
  
  <p>in system registry</p>
  
  <p>Any help is much appreciated</p>