1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2025-08-24 21:49:04 +02:00

Version 1.0 DEV 1.17f

Signed-off-by: dennis07 <den.goehlert@t-online.de>
This commit is contained in:
dennis07
2018-03-09 20:15:59 +01:00
parent c882232413
commit bd92e49339
4 changed files with 26 additions and 3 deletions

Binary file not shown.

View File

@@ -124,6 +124,13 @@ object fmMain: TfmMain
AutoSize = False
Caption = 'Mode:'
end
object imIcon: TImage
Left = 8
Top = 8
Width = 73
Height = 73
Center = True
end
object btExecute: TButton
Left = 8
Top = 224
@@ -157,7 +164,7 @@ object fmMain: TfmMain
end
object OpenDialog: TOpenDialog
Title = 'Select a file anywhere on your system'
Left = 400
Top = 8
Left = 384
Top = 88
end
end

View File

@@ -47,6 +47,7 @@ type
OpenDialog: TOpenDialog;
coExecuteMode: TComboBox;
laExecuteMode: TLabel;
imIcon: TImage;
procedure edPathChange(Sender: TObject);
procedure miBrowseClick(Sender: TObject);
procedure btExecuteClick(Sender: TObject);
@@ -107,6 +108,8 @@ begin
List.Clear;
ListFiles(CurrentFile.GetPath,List,['*.pas','*.dpr'],[fnExtension]);
lbOtherFiles.Items.Assign(List);
imIcon.Picture.Graphic := TIcon.Create;
imIcon.Picture.Graphic.Assign(CurrentFile.GetIcon);
finally
CurrentFile.Free;
List.Free;

View File

@@ -12,7 +12,7 @@ interface
uses
{ Standard-Units }
Classes, SysUtils, ShellAPI, Forms, Windows, Math,
Classes, SysUtils, ShellAPI, Forms, Windows, Math, Graphics,
{$IFNDEF NO_GENERIC}
Generics.Collections,
{$ENDIF}
@@ -118,6 +118,7 @@ type
function GetFileName(WithExt: Boolean = True): String; //ExtractFileName()
function GetFolderName: String; //ExtractFileFolder()
function GetSize: Int64; //GetFileSize()
function GetIcon(Index: Integer = 0): TIcon; //GetFileIcon(0)
//function GetVersion: Extended;
function GetAttributes: TFileAttributes; //GetFileAttributes();
function GetOwner: String;
@@ -161,6 +162,7 @@ type
function GetFileAccessed(FileName: String): TDateTime;
function GetFileAttributes(FileName: String): TFileAttributes;
function GetFileOwner(FileName: String): String;
function GetFileIcon(FileName: String; Index: Word = 0): TIcon;
const
PathDelims = [PathDelim,'/'];
@@ -737,6 +739,12 @@ begin
end;
end;
function GetFileIcon(FileName: String; Index: Word = 0): TIcon;
begin
Result := TIcon.Create;
Result.Handle := ExtractAssociatedIcon(HInstance, PChar(FileName), Index);
end;
{ ----------------------------------------------------------------------------
TDllManager
---------------------------------------------------------------------------- }
@@ -1030,6 +1038,11 @@ begin
Result := GetFileSize(FFileName);
end;
function TWinFile.GetIcon(Index: Integer = 0): TIcon;
begin
Result := GetFileIcon(FFileName, Index);
end;
function TWinFile.GetPath: String;
begin
Result := ExtractFilePath(FFileName); //Gesamter Ordnerpfad (ohne Dateiname)