Export (0) Print
Expand All
Expand Minimize

OFN Enumeration

Note: This API is now obsolete.

Enumeration that contains flags that specify the operation mode for GetOpenFileName methods.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.TeamFoundation.Common
Assembly:  Microsoft.VisualStudio.TeamFoundation.Client (in Microsoft.VisualStudio.TeamFoundation.Client.dll)

[FlagsAttribute]
[ObsoleteAttribute("The OFN enumeration is no longer used and will be removed in the subsequent release.")]
public enum OFN

Member nameDescription
OFN_ALLOWMULTISELECTWhen this flag is enabled, multiple selections in the file name list box are allowed.

OFN_CREATEPROMPTWhen this flag is enabled, the user is prompted for permission to create a file if it does not exist.

OFN_DONTADDTORECENTWhen this flag is enabled, the link to the opened file will not be added to the list of recently used documents.

OFN_ENABLEHOOKEnables the hook function.

OFN_ENABLEINCLUDENOTIFYEnables you to control which items the dialog box displays in the folder's item list.

OFN_ENABLESIZINGWhen this flag is enabled, the dialog box can be resized using either the mouse or the keyboard.

OFN_ENABLETEMPLATEUses the specified template object to generate an explorer window.If the OFN_EXPLORER flag is set, the system uses the specified template to create a dialog box that is a child of the default Explorer-style dialog box. If the OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box.

OFN_ENABLETEMPLATEHANDLEUses the specified template handle to generate a new explorer window.If the OFN_EXPLORER flag is set, the system uses the specified template to create a dialog box that is a child of the default Explorer-style dialog box. If the OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box.

OFN_EXPLORERIndicates that any customizations made to the Open or Save As dialog box use the Explorer-style customization methods.

OFN_EXTENSIONDIFFERENTThis flag is enabled if the user typed an extension that is different than the default.

OFN_FILEMUSTEXISTWhen this flag is enabled, the user can type only names of existing files in the File Name entry field.

OFN_FORCESHOWHIDDENWhen this flag is enabled, system and hidden files are shown regardless of user settings.

OFN_HIDEREADONLYWhen this flag is enabled, the read only check box is hidden.

OFN_LONGNAMESWhen this flag is enabled, the dialog box uses long file names. For Explorer-style dialog boxes, long file names are always enabled, regardless of this flag’s setting.

OFN_NOCHANGEDIRWhen this flag is enabled, the current directory cannot be changed.This flag is ineffective for GetOpenFileName.

OFN_NODEREFERENCELINKSWhen this flag is enabled, the path and filename of the shortcut link is returned; otherwise, the path and filename of the file the link references is returned.

OFN_NOLONGNAMESWhen this flag is enabled, long file names are suppressed. For Explorer-style dialog boxes, long filenames are always displayed.

OFN_NONETWORKBUTTONWhen this flag is enabled, the network button is hidden and disabled.

OFN_NOREADONLYRETURNWhen this flag is enabled, the returned file does not have the read-only check box selected and is not in a write-protected directory.

OFN_NOTESTFILECREATEWhen this flag is enabled, a test file is not created before the dialog box is closed.This means the function does not check for write protection, full disk, or network protection. Applications using this flag must perform file operations carefully, because a file cannot be reopened once it is closed.

OFN_NOVALIDATEWhen this flag is set, the common dialog boxes allow invalid characters in the returned file name.

OFN_OVERWRITEPROMPTWhen this flag is set, the user must confirm whether to overwrite the file if one already exists.

OFN_PATHMUSTEXISTWhen this flag is set, the user can type only valid paths and file names.

OFN_READONLYWhen this flag is set, the Read Only check box is initially selected when the dialog box is created. When the dialog box is closed, this flag indicates the state of the Read Only check box at close.

OFN_SHAREAWARESpecifies that if a call to the OpenFile function fails because of a network sharing violation, the error is ignored and the dialog box returns the selected file name. If this flag is not set, the dialog box notifies your hook procedure when a network sharing violation occurs for the file name specified by the user. If you set the OFN_EXPLORER flag, the dialog box sends the CDN_SHAREVIOLATION message to the hook procedure. If you do not set OFN_EXPLORER, the dialog box sends the SHAREVISTRING registered message to the hook procedure.

OFN_SHOWHELPWhen this flag is set, the help button is displayed.

These flags are used by the IVsUIShell.GetOpenFileNameViaDlg().

More information on the OPENFILENAME flags can be found on MSDN: OPENFILENAME Structure

Show:
© 2014 Microsoft