1:文件/文件夹 显示的图标:
#include <GdiPlus.h>
using namespace Gdiplus;
#pragma comment(lib,"gdiplus.lib")
void CTestGetFileICONDlg::ShowFileIcon( CString strFile )
{
// TODO: Add your control notification handler code here
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
// Initialize GDI+.
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
// strFile = "G:\\audio.mp3";
SHFILEINFO info;
SHGetFileInfo( strFile, 0, &info,sizeof(&info), SHGFI_DISPLAYNAME | SHGFI_ICON);
Bitmap pic( info.hIcon );
Graphics g(this->m_hWnd);
g.DrawImage(&pic, 0, 0);
}