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?