mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Show portable device icons
This commit is contained in:
parent
b91de2796c
commit
8ed520c49b
2 changed files with 14 additions and 8 deletions
|
|
@ -134,16 +134,20 @@ begin
|
|||
AFile.SizeProperty.IsValid:= False;
|
||||
end;
|
||||
|
||||
rgfInOut:= SFGAO_FILESYSTEM or SFGAO_FOLDER;
|
||||
AFolder.GetAttributesOf(1, PIDL, rgfInOut);
|
||||
AFile.Attributes:= FILE_ATTRIBUTE_DEVICE or FILE_ATTRIBUTE_VIRTUAL;
|
||||
|
||||
if (SFGAO_FILESYSTEM and rgfInOut) <> 0 then
|
||||
rgfInOut:= SFGAO_FILESYSTEM or SFGAO_FOLDER;
|
||||
|
||||
if Succeeded(AFolder.GetAttributesOf(1, PIDL, rgfInOut)) then
|
||||
begin
|
||||
AFile.Attributes:= FILE_ATTRIBUTE_VIRTUAL or FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
end
|
||||
else if (rgfInOut and SFGAO_FOLDER <> 0) then
|
||||
begin
|
||||
AFile.Attributes:= FILE_ATTRIBUTE_DIRECTORY
|
||||
if (SFGAO_FILESYSTEM and rgfInOut) <> 0 then
|
||||
begin
|
||||
AFile.Attributes:= AFile.Attributes or FILE_ATTRIBUTE_NORMAL;
|
||||
end
|
||||
else if (rgfInOut and SFGAO_FOLDER <> 0) then
|
||||
begin
|
||||
AFile.Attributes:= AFile.Attributes or FILE_ATTRIBUTE_DIRECTORY;
|
||||
end;
|
||||
end;
|
||||
|
||||
FFiles.Add(AFile);
|
||||
|
|
|
|||
|
|
@ -1976,6 +1976,8 @@ var
|
|||
FileInfo: TSHFileInfoW;
|
||||
dwFileAttributes: DWORD;
|
||||
uFlags: UINT;
|
||||
const
|
||||
FILE_ATTRIBUTE_SHELL = FILE_ATTRIBUTE_DEVICE or FILE_ATTRIBUTE_VIRTUAL;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := -1;
|
||||
|
|
@ -2023,7 +2025,7 @@ begin
|
|||
Exit;
|
||||
end
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
else if (AFile.Attributes = (FILE_ATTRIBUTE_REPARSE_POINT or FILE_ATTRIBUTE_VIRTUAL)) and Assigned(AFile.LinkProperty) then
|
||||
else if (AFile.Attributes and FILE_ATTRIBUTE_SHELL = FILE_ATTRIBUTE_SHELL) and Assigned(AFile.LinkProperty) then
|
||||
begin
|
||||
if not LoadIcon then
|
||||
Result := -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue