在哪里可以找到用于文件夹和应用程序的默认图标?

问题描述:

我正在尝试加载资源管理器显示的默认HICON:

I'm trying to load the default HICON that explorer displays for:


  • 打开的文件夹

  • 没有自己的嵌入式默认图标的exe。这也可以在Vista中调用的添加/删除程序或程序和功能中看到。

在哪里可以找到?我认为文件夹图标可能在explorer.exe的资源。但不知道可以从中检索默认应用程序图标。

Do you know where these can be found? I think the folder icon might be in the resources of explorer.exe. But have no idea where the default application icon can be retrieved from.

此外,您是否有任何示例代码可以将它们加载到HICON中。

And additionally, do you have any sample code that could load them into HICONs.

我真的需要这个在多个Windows操作系统上工作:2000,XP,Vista,2008

I really need this to work on multiple Windows OSs: 2000, XP, Vista, 2008


感谢您的帮助。我在Vista上,并通过Shell32.dll。我没有看到一个图标,看起来与浏览器中的应用程序显示的默认图标相同。

Thanks for the help so far. I'm on Vista and have looked through Shell32.dll. I don't see an icon in there that looks the same as the default one displayed by an application in explorer. I could be missing it - there are 278 icons to look through - is it definitely in there, or is there some other location I should look?

我认为他们在%windir%\system32\SHELL32.dll

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

在互联网上找到一些代码, p>

Found some code in the internet, try if that works:

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


Windows在moricons.dll中有更多的图标,但我认为文件和文件夹图标都应该在shell32.dll中。提醒,Vista中的图标有不同的分辨率,高达256x256,所以你正在看的分辨率32x32的图标可能看起来不同于同一图标的全分辨率版本。

Windows has a lot more icons in the "moricons.dll", but I think the file and folder icons should all be in the shell32.dll. Remind, that icons in Vista have different resolutions, up to 256x256, so the icon you are looking at a resolution 32x32 might look different then the full resolution version of the same icon.