V.2.9
eOpenFileFlags Enum

Used in the 
ShowOpen and ShowSave methods of the clsCommonDialogs class

Public Enum eOpenFileFlags
    OFN_ALLOWMULTISELECT = &H200
    OFN_CREATEPROMPT = &H2000
    OFN_EXPLORER = &H80000 
'new look commdlg (automatically USED)
    OFN_EXTENSIONDIFFERENT = &H400 
'OUT
    OFN_FILEMUSTEXIST = &H1000
    OFN_HIDEREADONLY = &H4
    OFN_NOCHANGEDIR = &H8
    OFN_NODEREFERENCELINKS = &H100000
    OFN_NONETWORKBUTTON = &H20000
    OFN_NOREADONLYRETURN = &H8000 
'OUT
    OFN_NOTESTFILECREATE = &H10000
    OFN_NOVALIDATE = &H100
    OFN_OVERWRITEPROMPT = &H2
    OFN_PATHMUSTEXIST = &H800
    OFN_READONLY = &H1
    OFN_SHOWHELP = &H10
End Enum

Documentation (from MSDN):

OFN_ALLOWMULTISELECT

Specifies that the File Name list box allows multiple selections. If you also set the 
OFN_EXPLORER flag, the dialog box uses the Explorer-style user interface; otherwise, 
it uses the old-style user interface. 
If the user selects more than one file, the lpstrFile buffer returns the path to the 
current directory followed by the file names of the selected files. The nFileOffset 
member is the offset, in bytes or characters, to the first file name, and the 
nFileExtension member is not used. For Explorer-style dialog boxes, the directory and 
file name strings are NULL separated, with an extra NULL character after the last file 
name. This format enables the Explorer-style dialog boxes to return long file names 
that include spaces. For old-style dialog boxes, the directory and file name strings are 
separated by spaces and the function uses short file names for file names with spaces. 
You can use the FindFirstFile function to convert between long and short file names. 

If you specify a custom template for an old-style dialog box, the definition of the File 
Name list box must contain the LBS_EXTENDEDSEL value.

OFN_CREATEPROMPT

If the user specifies a file that does not exist, this flag causes the dialog box to prompt 
the user for permission to create the file. If the user chooses to create the file, the 
dialog box closes and the function returns the specified name; otherwise, the dialog 
box remains open. If you use this flag with the OFN_ALLOWMULTISELECT flag, the 
dialog box allows the user to specify only one nonexistent file.  

OFN_EXPLORER (Automatically USED)

Indicates that any customizations made to the Open or Save As dialog box use the new 
Explorer-style customization methods. For more information, see Explorer-Style Hook 
Procedures and Explorer-Style Custom Templates. 
By default, the Open and Save As dialog boxes use the Explorer-style user interface 
regardless of whether this flag is set. This flag is necessary only if you provide a hook 
procedure or custom template, or set the OFN_ALLOWMULTISELECT flag. 

If you want the old-style user interface, omit the OFN_EXPLORER flag and provide a 
replacement old-style template or hook procedure. If you want the old style but do not 
need a custom template or hook procedure, simply provide a hook procedure that 
always returns FALSE.

OFN_EXTENSIONDIFFERENT (OUT)

Specifies that the user typed a file name extension that differs from the extension 
specified by lpstrDefExt. The function does not use this flag if lpstrDefExt is NULL.

OFN_FILEMUSTEXIST

Specifies that the user can type only names of existing files in the File Name entry field. 
If this flag is specified and the user enters an invalid name, the dialog box procedure 
displays a warning in a message box. If this flag is specified, the 
OFN_PATHMUSTEXIST flag is also used.

OFN_HIDEREADONLY

Hides the Read Only check box. 

OFN_NOCHANGEDIR

Restores the current directory to its original value if the user changed the directory 
while searching for files.

OFN_NODEREFERENCELINKS

Directs the dialog box to return the path and file name of the selected shortcut (.LNK) 
file. If this value is not specified, the dialog box returns the path and file name of the 
file referenced by the shortcut. 

OFN_NONETWORKBUTTON

Hides and disables the Network button.

OFN_NOREADONLYRETURN (OUT)

Specifies that the returned file does not have the Read Only check box selected and is 
not in a write-protected directory.

OFN_NOTESTFILECREATE

Specifies that the file is not created before the dialog box is closed. This flag should be 
specified if the application saves the file on a create-nonmodify network share. When 
an application specifies this flag, the library does not check for write protection, a full 
disk, an open drive door, or network protection. Applications using this flag must 
perform file operations carefully, because a file cannot be reopened once it is closed.

OFN_NOVALIDATE

Specifies that the common dialog boxes allow invalid characters in the returned file 
name. Typically, the calling application uses a hook procedure that checks the file 
name by using the FILEOKSTRING message. If the text box in the edit control is empty 
or contains nothing but spaces, the lists of files and directories are updated. If the text 
box in the edit control contains anything else, nFileOffset and nFileExtension are set to 
values generated by parsing the text. No default extension is added to the text, nor is 
text copied to the buffer specified by lpstrFileTitle. 
If the value specified by nFileOffset is less than zero, the file name is invalid. 
Otherwise, the file name is valid, and nFileExtension and nFileOffset can be used as if 
the OFN_NOVALIDATE flag had not been specified.
 
OFN_OVERWRITEPROMPT

Causes the Save As dialog box to generate a message box if the selected file already 
exists. The user must confirm whether to overwrite the file. 

OFN_PATHMUSTEXIST

Specifies that the user can type only valid paths and file names. If this flag is used and 
the user types an invalid path and file name in the File Name entry field, the dialog box 
function displays a warning in a message box.

OFN_READONLY

Causes the Read Only check box to be selected initially when the dialog box is created. 
This flag indicates the state of the Read Only check box when the dialog box is closed.

OFN_SHOWHELP

Causes the dialog box to display the Help button. The hwndOwner member must 
specify the window to receive the HELPMSGSTRING registered messages that the 
dialog box sends when the user clicks the Help button. 
An Explorer-style dialog box sends a CDN_HELP notification message to your hook 
procedure when the user clicks the Help button. 
(You can use the cUniSubClass 
class to catch windows messages)

 
http://www.hexagora.com
Wed, 14 May 2008 10:05:53 UT
Copyright 2003-10 by Lorenzi Davide