Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get icon from api

Status
Not open for further replies.

cag3

Programmer
Apr 20, 2003
4
JO
the path to the api is wrong, i dont get it, if i fill instead of
SHGetFileInfo(pathandfile
SHGetFileInfo("c:\\"

i do get the right icon /???

snippet:

/////////////////////////////////
String ding = "C:\\" + LocalFile;
char *pathandfile= ding.c_str();

ShowMessage(pathandfile);

SHFILEINFO info;
DWORD result = SHGetFileInfo(pathandfile,
0,
&info,
sizeof(info),
SHGFI_ICON |
SHGFI_SMALLICON |
SHGFI_SHELLICONSIZE |
SHGFI_SYSICONINDEX);

if(result != 0)
ImageList1->GetIcon(5,Image1->Picture->Icon);
pItem->ImageIndex = 5;
}
/////////////////////////////////
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top