TIEPortableDevices.Objects
Declaration
property Objects[Index: Integer]: TIEWPDObject; (read-only)
Description
An array of all objects found in the
current folder of the
active device.
The
objects list is filled after a successful call to any of the following:
◼NavigateToFolderID◼NavigateToFolderPath◼NavigateToParent◼FindFilesByName◼FindFilesOfType◼Or by setting
ActiveFolderID// Navigate to folder and fill list box with its object IDs
procedure TfrmMain.OpenFolder(const sFolderID : WideString);
var
I: Integer;
begin
fPortableDevices.ActiveFolderID := sFolderID;
lbxObjects.Items.Clear;
for I := 0 to fPortableDevices.ObjectCount - 1 do
lbxObjects.Items.Add( fPortableDevices.Objects[ I ].ID );
end;
// Save the selection to a file and launch it
Idx := fPortableDevices.ObjectIDToIndex( lbxObjects.Items[ lbxObjects.ItemIndex ] );
aObject := fPortableDevices.Objects[ Idx ];
if aObject.ObjectType <> iewFolder then
begin
sFilename := IncludeTrailingPathDelimiter( ExtractFilePath( Application.ExeName )) + aObject.Filename;
if fPortableDevices.CopyFileFromDevice(SelectedDeviceID, aObject.ID, sFileName) then
ShellExecute( Handle, 'open', PChar( sFileName ), nil, nil, SW_MAXIMIZE );
end;