Redlord
asked on
Associated Icon
how can i get the icon that is associated with a file/file type?
ex: txt files have the icon
shell32.dll -152
but i dont want that text i want the HICON
NOTE: only windows API please no MFC,OWL,ect..
ex: txt files have the icon
shell32.dll -152
but i dont want that text i want the HICON
NOTE: only windows API please no MFC,OWL,ect..
ASKER
That would get the icon in the dll (or exe) with a specific index, NOT the icon that is acosiated with the file or file type.
what i want is a function that i can pass: "c:\windows\desktop\mytext .txt" and get back an HICON with the icon that is acosiated with txt files
the function would also have to get the first (index = 0) icon for an exe or dll and whatever icon a lnk file uses
what i want is a function that i can pass: "c:\windows\desktop\mytext
the function would also have to get the first (index = 0) icon for an exe or dll and whatever icon a lnk file uses
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not very indepth but works for me :)
See the ExtractIcon() Windows API function.
HICON ExtractIcon(
HINSTANCE hInst, // instance handle
LPCTSTR lpszExeFileName, // file name
UINT nIconIndex // icon index
);