综合

img bohut

获得exe的图标

发表于2004/10/29 9:40:00  759人阅读

1.
HICON hIcon=::ExtractIcon(AfxGetInstanceHandle(),_T("NotePad.exe"),0);
if (hIcon &&hIcon!=(HICON)-1)
{
    pDC->DrawIcon(10,10,hIcon);
}
DestroyIcon(hIcon);

2.
SHFILEINFO info;
CString strFileName = "C://Winnt//Notepad.exe";
SHGetFileInfo(strFileName,&info,sizeof(&info),SHGFI_DISPLAYNAME | SHGFI_ICON);
int i = m_ImageList.Add(info.hIcon);
m_list.InsertItem(0,info.szDisplayName,i);
阅读全文
0 0

相关文章推荐

img
取 消
img