int fileNameLenth=strFileName.GetLength()-strFileName.ReverseFind('.')-1;
CString ext=strFileName.Right(fileNameLenth);
CString sDummyFileName = _T("empty.") + ext;
SHFILEINFO shfi;
memset(&shfi,0,sizeof(shfi));
SHGetFileInfo(sDummyFileName,
FILE_ATTRIBUTE_NORMAL,
&shfi,
sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES);
HICON hIcon=shfi.hIcon;