ImageEn, unit iexWPD

TIEPortableDevices.NavigateToFolderID

TIEPortableDevices.NavigateToFolderID


Declaration

function NavigateToFolderID(const sFolderID : WideString; bIncludeSubFolders : Boolean = False; GetTypes: TIEWPDObjectTypes = [iewFile, iewFolder]) : Boolean; overload;
function NavigateToFolderID(const sDeviceID, sFolderID : WideString; bIncludeSubFolders : Boolean = False; GetTypes: TIEWPDObjectTypes = [iewFile, iewFolder]) : Boolean; overload;


Description

Navigates to a folder specified by an Object ID and fills the objects list.

The ID can be any object in the objects list of ObjectType = iewFolder.

Parameter Description
sDeviceID The device to open (if not specified then the active device is used)
sFolderID The ID of a folder object to open. Can be '' to open the device root folder
bIncludeSubFolders Whether to also retrieve objects in sub-folders
GetTypes They type of objects to returns, files (iewFile), folders (iewFolder) or both

Result is false if an error was detected. You can check LastError for detail on the failure.

ActiveDeviceID and ActiveFolderID will be updated after calling NavigateToFolderID. Use of NavigateToFolderID(const sDeviceID, sFolderID ); is the same as setting:
ActiveDeviceID := sDeviceID;
ActiveFolderID := sFolderID;



Example

// Open folder on double click
procedure TfrmMain.lbxObjectsDblClick(Sender: TObject);
var
  Idx: Integer;
  aObject: TIEWPDObject;
begin
  if ( lbxObjects.ItemIndex >= 0 ) and
     fPortableDevices.ObjectIsFolder( lbxObjects.Items[ lbxObjects.ItemIndex ] ) then
  begin
    // Fill Objects with items in this folder
    if fPortableDevices.NavigateToFolderID( lbxObjects.Items[ lbxObjects.ItemIndex ] ) then
    begin
      lbxObjects.Items.Clear;
      for I := 0 to fPortableDevices.ObjectCount - 1 do
        lbxObjects.Items.Add( fPortableDevices.Objects[ I ].ID );
    end;
  end;
end;