08-10-2016, 03:30 PM
I would like to use in one of my dialogs the icon associated to a certain file type, which of course may vary. I found many useful topics in the Forum, and I concluded to the following function :
Function tempf10
However, I have difficulty in interpreting the icon handle, namely &x.hIcon
Any advice will be much appreciated.
Function tempf10
;ITEMIDLIST to display name
;www.quickmacros.com/forum/viewtopic.php?p=30548
ITEMIDLIST* pidl=PidlFromStr("C:\tmp\hlp.txt")
SHFILEINFOW x
int ok=SHGetFileInfoW(+pidl 0 &x sizeof(x) SHGFI_PIDL|SHGFI_DISPLAYNAME|SHGFI_SYSICONINDEX)
CoTaskMemFree pidl
if(!ok) end "failed"
str s.ansi(&x.szDisplayName)
out s
x.hIcon
out x.iIcon
However, I have difficulty in interpreting the icon handle, namely &x.hIcon
Any advice will be much appreciated.