I am trying to use some system icons such as SIID_DOCNOASSOC
and SIID_FOLDER
and draw them.
I have the problem that while my code works as expected in Windows 7, on Windows 10 the retrieved images are missing their mask. I cannot figure out why (the PICONINFO.hbmMask
field that I can retrieve with GetIconInfo
is non-null, indicating that there is a mask, indeed).
My code is written in Xojo, which uses a dialect of VB, but that should hardly matter, as I got it working in Win 7, I'd think:
dim info as SHSTOCKICONINFO
info.cbSize = SHSTOCKICONINFO.Size
SHGetStockIconInfo (SIID_DOCNOASSOC, SHGSI_ICON, info)
dim iconHandle as Integer = info.hIcon
dim destDC as Integer = ... // intialized outside
DrawIconEx (destDC, 0, 0, iconHandle, 0, 0, 0, 0, DI_MASK)
The above code fetched the icon for a plain file and then draws its mask. While the mask is correct on Win 7, the mask is all black over the entire icon's area on Win 10.
Why would that happen?