Description

Calls the common Windows File dialog box, either in Open or Save As mode.

Parameters

ParameterDescription
<object>Owner window
<value>

@FM-delimited array:

ValueDescription
<1><mode>

0 = Open dialog

1 = Save As dialog

<2>Filter buffer
<3>Filter index
<4>Init name
<5>Flags. Consult MSDN for a possible flag values.
<6>Initial Directory
returnvalueFull path of selected file (null if operation was canceled).

Only the first field (<mode>) is required.

Example

/* This code returns as output the variable File which has the new name selected. 
The selection types for this example dialog are bitmaps and all files. 
For each file type, supply the description followed by "/" followed by the file filter followed by "/".   */
 
CFOpt = ""
CFOpt<1> = 0    ;* open dialog
CFOpt<2> = "Bitmaps (*.bmp)/*.bmp/All Files (*.*)/*.*/"
CFOpt<3> = 1    ;* default type is the first one (bitmaps)
CFOpt<4> = "oilogon.bmp"    ;* default filename
CFOpt<5> = 0x200 ; * OFN_ALLOWMULTISELECT from the Microsoft SDK
CFOpt<6> = drive() : "\BMPS\" ; * initial directry
File = Utility("CHOOSEFILE", @window, CFOpt)
Call msg(@window, "You selected the file " : File)

Remarks

For more information about Flags, refer to the Microsoft Windows SDK.

See Also

Utility function.

  • No labels