Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find the icon associated to a certain file type
#1
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
Code:
Copy      Help
;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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)