int MultiFileSelectPopup (char defaultDirectory[], char defaultFileSpec[], char fileTypeList[], char title, int restrictDirectory, int restrictExtension, int allowCancel, int *numberOfSelectedFiles, char **fileList);
Displays a multi-file selection dialog box and waits for the user to select a set of files or cancel.
Input | ||||
Name | Type | Description | ||
defaultDirectory | string | Initial directory. If you enter "", the function uses the current working directory.
|
||
defaultFileSpec | string | String that specifies which files to display. For example, "*.c" causes all files with the .c extension to be displayed. The defaultFileSpec appears in the filename box when you initially display the pop-up dialog box. If you specify an actual filename, such as test.c, that name appears in the filename box and also in the file list box. defaultFileSpec cannot contain a directory path. |
||
fileTypeList | string | List of file types, separated by semicolons, to display in the file type list of the File Select pop-up dialog box when restrictExtension is FALSE. For example, "*.c;*.h" allows the user to select "*.c" or "*.h" from the file type list. The all files, *.*, option is always available. | ||
title | string | Title of the dialog box. | ||
restrictDirectory | integer | If nonzero, the user cannot change directories or drives. If zero, the user can change directories or drives. |
||
restrictExtension | integer | If nonzero, the user is limited to files with the default extension. If zero, the user can select files with any extension. |
||
allowCancel | integer | If nonzero, the user can cancel out of the File Select pop-up dialog box. If zero, the user can leave the pop-up dialog box only by making a selection. |
||
Output | ||||
Name | Type | Description | ||
numberOfSelectedFiles | integer | Number of files selected by the user. | ||
fileList | string | Buffer that contains an array of strings, where each string is the name of one of the files selected. The last element of the array is a NULL pointer. The buffer is automatically allocated by MultiFileSelectPopup and is accessible as an array of strings. When you no longer need them, free each string and the array with the free function. The following example illustrates how to free each string in the file list and then free the file list array itself.
char **fileList = NULL, **ppc = NULL; |
Name | Type | Description | ||||||
selectionStatus | integer | The selection status or error codes generated during the function call.
Negative values indicate that an error occurred. |