Quote:
Originally Posted by hitman797
but we need to add this function:
System.IOUtils:
Code:
function TDirectory.GetFiles(const Path: string): TStringDynArray;
function TDirectory.GetDirectories(const Path: string): TStringDynArray;
function TDirectory.GetLogicalDrives: TStringDynArray;
TArrayOfString = array of String; in innosetup
ListBox:
Code:
procedure ListBoxItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
Label:
Code:
function GetText: WideString;
|
i think you may not have noticed that FMXInno has already included these things.
Quote:
Originally Posted by hitman797
Code:
function TDirectory.GetFiles(const Path: string): TStringDynArray;
|
Code:
var
FindHandle: Longint;
begin
FindHandle := pFindFiles('C:\Test01', '*.*', '', ffrkRelative, True, False);
if FindHandle <> 0 then
begin
WinTB1.Text('Files: ' + IntToStr(pFileCount(FindHandle)));
try
for i:=0 to pFileCount(FindHandle)-1 do
Memo.AddLine(pPickFile(FindHandle, i));
finally
pFindFree(FindHandle);
end;
end;
end;
Quote:
Originally Posted by hitman797
Code:
function TDirectory.GetDirectories(const Path: string): TStringDynArray;
|
Code:
var
FindHandle: Longint;
begin
FindHandle := pFindFiles('C:\Test01', '*', '', ffrkRelative, True, True);
if FindHandle <> 0 then
begin
WinTB1.Text('Dirs: ' + IntToStr(pDirCount(FindHandle)));
try
for i:=0 to pDirCount(FindHandle)-1 do
Memo.AddLine(pPickDir(FindHandle, i));
finally
pFindFree(FindHandle);
end;
end;
end;
Quote:
Originally Posted by hitman797
Code:
function TDirectory.GetLogicalDrives: TStringDynArray;
|
Code:
begin
LogicalDrives.FCreate;
if LogicalDrives.Count > 0 then
begin
for i := 0 to LogicalDrives.Count - 1 do
Memo.AddLine(LogicalDrives.Letter(i));
end else
MsgBox('"LogicalDrives" failded!', mbError, MB_OK);
end;
Quote:
Originally Posted by hitman797
ListBox:
Code:
procedure ListBoxItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
|
Code:
procedure ListBoxOnChange(Sender: TObject);
var
i: integer;
TargetLstItm: FListBoxItem;
begin
if ListBox.GetItemIndex > -1 then
begin
for i := 0 to length(ListBoxItems)-1 do
if Sender = TObject(ListBoxItems[i].GetObject) then
begin
TargetLstItm := ListBoxItems[i] as FListBoxItem;
break;
end;
WinTB1.Text(TargetLstItm.GeText);
end;
end;
ListBox.FCreate(FMXForm.Handle);
ListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
ListBox.OnChange(@ListBoxOnChange);