0

I am currently trying to make some modifications to some existing .NET code as I want to extend the current functionality. Unfortunately I do not have much experience in MSDN and need help with the namespaces.

The current code uses SystemIcons.WinLogo.ExtractAssociatedIcon to get the image data for an icon, but this results in tiny images. I want larger images and have found several possible solutions, such as Get icon 128*128 File type C#. The issue arises when I try to use/modify this code in the existing project that many of the referenced names are not recognized:

  • HICON
  • SHFILEINFO
  • Shell32
  • SHGFI
  • LPCTSTR
  • etc

All of the stackoverflow and other resources fail to mention the used namespaces in their solutions; likely because this is knowledge that is assumed to be known. It would be greatly appreciated if someone could indicate what namespaces I should be including/referencing to get access to some of these types and functions.

  • 1
    The answer you linked doesn't *fail to mention the used namespaces*. It's all included in the last two sections: `Native wrapper` and `Native structures`. I can assure you that the code you linked is not only complete but perfectly working (as it is). If a .Net namespaces is not mentioned is because it's obvious and also because you can just press `ALT+ENTER` on the object that is *missing a reference* to get the `using` for it. – Jimi Mar 30 '20 at 00:10
  • Thanks, I feel a bit foolish that I missed that. Your answer is very helpful as I also did not know of the ALT+ENTER shortcut, which helped me discover that I was also missing System.Runtime.InteropServices – Jordan Austin Mar 31 '20 at 05:52

0 Answers0