ImageEn, unit iexWPD

TIEPortableDevices.FindFilesOfType

TIEPortableDevices.FindFilesOfType


Declaration

function FindFilesOfType(const sDeviceID, sFolderID: WideString; sFileExtensions: String; iMaxDepth : Integer = 0): Boolean; overload;
function FindFilesOfType(const sFolderID: WideString; sFileExtensions: String; iMaxDepth : Integer = 0): Boolean; overload;


Description

Searches for files of the specified file extensions and fills the objects list.

Parameter Description
sDeviceID The device to open (if not specified then the active device is used)
sFolderID The ID of a folder to search. Can be '' to search the whole device
sFileExtensions The file types to return, in the format '*.jpg;*.jpeg;*.bmp;'
iMaxDepth How many folders to search below the current folder, -1: Search all sub-folders, 0: Search only the specified folder, 1: Search the specified folder and the next level of sub-folders, etc.

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

Note: Will only return files, i.e. objects of type iewFile


Example

// Return all images in the camera folder of a smart phone
sFolderID := PathToFolderID( 'Card\DCIM\';
if sFolderID <> '' then
  if FindFilesOfType( sFolderID, '*.jpg;*.jpeg' ) then
  begin
    lbxObjects.Items.Clear;
    for I := 0 to fPortableDevices.ObjectCount - 1 do
      lbxObjects.Items.Add( fPortableDevices.Objects[ I ].ID );
  end;