SelectMultipleFile

User dialog function.

The SelectMultipleFile function returns an array containing the LONG names of the files selected by the user in the standard File Open dialog. Not available in WinTask Lite.

Syntax

SelectMultipleFile(<title>,<directory>,<filter>,<selected_directory>,<array>)
or
a=SelectMultipleFile(<title>,<directory>,<filter>,<selected_directory>,<array>)

Parameters

<title>: string, title of the File Open dialog.

<directory>: initial directory in the File Open dialog; if empty, the current directory is used.

<filter>: file extensions listed in the File Open dialog; first the extension, followed by the label of this extension; all the arguments are separated by the character ;.

<selected_directory>: directory selected by the user.

<array>: array containing the list of files selected by the user. The array must have been previously declared using the DIM statement.

Return value

a, return variable, number of files selected.

Remarks

Sometimes, SelectMultipleFile does not bring to focus the Select files dialog box under the 64 bits editions of Windows. Add this key in Registry if you notice this behavior when using SelectMultipleFile:
HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout
Dword with the value 30d40

Examples

 

DIM file_tab$(10)

a=SelectMultipleFile("Select the files" , "c:\worddocs","*.txt;text files (*.txt);*.doc ;documents (*.doc)", dir$, file_tab$())

The array File_tab will contain all the selections made by the user in the File Open dialog box where all the files in C:\docs are listed:

Dim file_tab$(100)

 

SelectMultipleFile("Select the files","c:\docs","*.*;All files(*.*)", dir$, file_tab$())

msgbox(file_tab$(0))