Where can I find the default icons used for folders and applications?

I am trying to load HICON by default, which shows the explorer for:

  • Open folder
  • An instance that does not have a built-in default icon. This can also be seen in the "Add or Remove Programs" or "Programs and Features" section, as it is called Vista.

Do you know where to find them? I think the folder icon may be in explorer.exe resources. But I have no idea where to get the default application icon from.

In addition, you have sample code that can upload them to HICONs.

I really need this to work with several Windows OS: 2000, XP, Vista, 2008


Thanks for the help. I am in Vista and am viewing Shell32.dll. I do not see the icon there, which looks the same as the default displayed by the application in Explorer. Could I skip this - are there 278 icons that need to be viewed - is it definitely there, or is there some other place that I have to look at?

+3
source share
8 answers

I think they are in% windir% \ system32 \ SHELL32.dll

Found code on the Internet, try if it works:

HINSTANCE hDll;
hDll = LoadLibrary ( "SHELL32.dll" );
wincl.hIcon   = LoadIcon (hDll , MAKEINTRESOURCE ( 1 ));
wincl.hIconSm = LoadIcon (hDll, MAKEINTRESOURCE ( 2 ));

: "moricons.dll" Windows , , shell32.dll. , Vista , 256x256, , 32x32, , .

+2

API SHGetFileInfo.

SHFILEINFO sfi;
SecureZeroMemory(&sfi, sizeof sfi);

SHGetFileInfo(
    _T("Doesn't matter"),
    FILE_ATTRIBUTE_DIRECTORY,
    &sfi, sizeof sfi,
    SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);

.

"open" (.. , ), SHGFI_OPENICON SHGetFileInfo().

[]

, , ! , , / Windows. , dll/exes, , .

+13

Vista SHGetStockIconInfo .. NT6 + . SHGetFileInfo, , .

, 5 ( NT, - 5 , SHGetFileInfo). shell32.dll , (HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons)

+6

Visual Studio:

  • "" | ""
  • C:\WINDOWS\System32\Shell32.dll

VS . , shell32.dll.

+2

, , HKEY_CLASSES_ROOT\Folder\DefaultIcon

, , .

, desktop.ini, IconFile IconIndex.

+2

MFC, .

    HICON hicon;
    hicon = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON1));   

AfxGetResourceHandle() - , MFC, LoadIcon - API, .

windows\system32\shell32.dll

​​ , , "C:\Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary"

+1

, explorer.exe.

-1

, shell32.dll "ICONS" .

.

[link] http://www.angusj.com/resourcehacker/[/link]

-1

All Articles