I'm trying to get the icon out of a .lnk file without the .lnk overlay appearing. The documentation has information about a flag SHGFI_ADDOVERLAYS
which can be set to add an overlay, but I am looking to remove the overlay.
I have read this question, as well as the links inside of it, but I am still unable to get it working in c#.
Here is the code I have tried:
SHFILEINFO shFileInfo = new SHFILEINFO();
SHGetFileInfo(
pathToLnk,
0,
ref shFileInfo,
(uint)Marshal.SizeOf(shFileInfo),
SHGFI_ICON & ~SHGFI_LINKOVERLAY);
As well as some other configurations of the flags.
Thanks in advance for the help.