Thanks for the tip. If all else fails I will do that. However, I am trying to make a game menu program and I would like to automate the process. Currently on p18, cag3 gave a code snippet to question "get icon from api". I seem be be able to get the handle of the System Image List and the index of the ICON that I want from that list. What I am missing is how to get the ICON from the System Image List to an Image List on my form. From what I've been able to research, I should be able to do it using ImageList commands but nothing I've tried seems to work.
if (OpenDialog1->Execute())
{
// Get Large Icon System Image List Handle
SystemImageListHandle = (HIMAGELIST)SHGetFileInfo(
OpenDialog1->FileName.c_str(),
FILE_ATTRIBUTE_NORMAL,
&FileInfo,
sizeof(FileInfo),
SHGFI_SYSICONINDEX |SHGFI_LARGEICON);
// SHFILEINFO contains Handle of the Icon (hIcon) and the index of the
// Icon (iIcon) in the Large Icon System Image List. For Small Icon use
// SHGFI_SMALLICON in place of SHGFI_LARGEICON.
// Extract Icon from the Image List
SytemImageListIconHandle = ImageList_GetIcon(
SystemImageListHandle,
FileInfo.iIcon,
ILD_NORMAL);
// Set myIcon
myIcon->Handle = SytemImageListIconHandle;
// Display myIcon in Image1
Image1->Picture->Icon = myIcon;
}
else
{
ShowMessage("File Dialog would not open"
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.