tags:

views:

37

answers:

1

For some reason, calling SHGetFileInfo for an .lnk file returns icons with a link overlay, even when I don't request it:

Shell.SHGetFileInfo(path, 0, ref shFileInfo, (uint)Marshal.SizeOf(shFileInfo),
SHGFI.ICON | SHGFI.SMALLICON | SHGFI.TYPENAME | SHGFI.DISPLAYNAME);

I'm using shFileInfo.hIcon to get the icon handle (Windows 7, x64). Any suggestions on why this is happening, and how to get the icons without the overlay?

+1  A: 

I was finally able to resolve this by obtaining the icon's index in the system image list and using ImageList_GetIcon to get the handle to an overlay-less icon:

http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/83817b05-580e-476a-916f-eb3309cda7bb

Melllvar