002
24.05.2006, 18:24 Uhr
mmc20
puss in boots
|
hi, das icon einer datei/anwendung...
C++: |
HICON GetFileIcon(LPCTSTR szPath) { SHFILEINFO shfi = { 0 }; HICON hIcon;
if( szPath != NULL ) { ASSERT( AfxIsValidString( szPath, MAX_PATH ) );
HIMAGELIST hIml = (HIMAGELIST)::SHGetFileInfo( szPath, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof( SHFILEINFO ), SHGFI_SYSICONINDEX );
if( hIml != NULL ) { hIcon= ::ImageList_ExtractIcon( NULL, hIml, shfi.iIcon ); hIml = NULL; } } return hIcon; }
|
und die systemicons...
C++: |
HICON GetSystemIcon( int nIndex, BOOL bLargeIcons ){ HICON hIcon; ExtractIconEx( _T("SHELL32.DLL"), nIndex, bLargeIcons ? &hIcon : NULL, bLargeIcons ? NULL : &hIcon, 1 ); return hIcon; }
|
|