In Delphi XE7, I need to get the LOCATION of the icon used by Windows Explorer to display a folder, especially in thumbnail view. So I use this code:
var
Shell32DllFilePath: string;
// Get shell32.dll FilePath:
Shell32DllFilePath := IncludeTrailingPathDelimiter(JclSysInfo.GetWindowsSystemFolder) + 'shell32.dll';
if not FileExists(Shell32DllFilePath) then
begin
Shell32DllFilePath := '';
// Todo: log this error
end;
Then I ASSUME that the default folder icon is the icon with IconIndex 3
in shell32.dll
:
However, this gives me a static image for every folder, while Windows Explorer uses different folder icons according to the folder location and/or the folder content.
So how can I get the exact folder icon location (icon dll file and icon index) Windows Explorer uses for any SPECIFIC folder?
There may not be a file path to an icon with the way Windows works. You mention "especially in thumbnail view", which means images and icons (within the folder) are stacked together in the folder icon. This does not save a file anywhere, so you can't load from any file.
I'm assuming this is the type of icon you're talking about: