1 out of 1 rated this helpful - Rate this topic

IFileDialog::GetOptions method

Gets the current flags that are set to control dialog behavior.

Syntax


HRESULT GetOptions(
  [out]  FILEOPENDIALOGOPTIONS *fos
);

Parameters

fos [out]

Type: FILEOPENDIALOGOPTIONS*

A pointer to a value made up of one or more of the following flags:

FOS_OVERWRITEPROMPT (0x00000002)

When saving a file, prompt before overwriting an existing file of the same name. This is a default value for the Save dialog.

FOS_STRICTFILETYPES (0x00000004)

In the save dialog, only allow the user to choose a file that has one of the file name extensions provided in IFileDialog::SetFileTypes.

FOS_NOCHANGEDIR (0x00000008)

Not used.

FOS_PICKFOLDERS (0x00000020)

Present the Open dialog offering a choice of folders rather than files.

FOS_FORCEFILESYSTEM (0x00000040)

Ensures that returned items are file system items (SFGAO_FILESYSTEM). Note that this does not apply to items returned by IFileDialog::GetCurrentSelection.

FOS_ALLNONSTORAGEITEMS (0x00000080)

Enables the user to choose any item in the Shell namespace, not just those with SFGAO_STREAM or SFAGO_FILESYSTEM attributes. This flag cannot be combined with FOS_FORCEFILESYSTEM.

FOS_NOVALIDATE (0x00000100)

Do not check for situations that would prevent an application from opening the selected file, such as sharing violations or access denied errors.

FOS_ALLOWMULTISELECT (0x00000200)

Enables the user to select multiple items in the open dialog. Note that when this flag is set, the IFileOpenDialog interface must be used to retrieve those items.

FOS_PATHMUSTEXIST (0x00000800)

The item returned must be in an existing folder. This is a default value.

FOS_FILEMUSTEXIST (0x00001000)

The item returned must exist. This is a default value for the Open dialog.

FOS_CREATEPROMPT (0x00002000)

Prompt for creation if the item returned in the save dialog does not exist. Note that this does not actually create the item.

FOS_SHAREAWARE (0x00004000)

In the case of a sharing violation when an application is opening a file, call the application back through OnShareViolation for guidance. This flag is overridden by FOS_NOVALIDATE.

FOS_NOREADONLYRETURN (0x00008000)

Do not return read-only items. This is a default value for the Save dialog.

FOS_NOTESTFILECREATE (0x00010000)

Do not test creation of the item returned in the save dialog. If this flag is not set, the calling application must handle errors such as denial of access discovered in the creation test.

FOS_HIDEMRUPLACES (0x00020000)

Hide the list of places from which the user has recently opened or saved items.

FOS_HIDEPINNEDPLACES (0x00040000)

Hide items shown by default in the view's navigation pane. This flag is often used in conjunction with the IFileDialog::AddPlace method, to hide standard locations and replace them with custom locations.

Windows 7 and later. Hide all of the standard namespace locations (such as Favorites, Libraries, Computer, and Network) shown in the navigation pane.

Windows Vista. Hide the contents of the Favorite Links tree in the navigation pane. Note that the category itself is still displayed, but shown as empty.

FOS_NODEREFERENCELINKS (0x00100000)

Shortcuts should not be treated as their target items, allowing an application to open a .lnk file.

FOS_DONTADDTORECENT (0x02000000)

Do not add the item being opened or saved to the recent documents list (SHAddToRecentDocs).

FOS_FORCESHOWHIDDEN (0x10000000)

Show hidden and system items.

FOS_DEFAULTNOMINIMODE (0x20000000)

Indicates to the Save As dialog box that it should open in expanded mode. Expanded mode is the mode that is set and unset by clicking the button in the lower-left corner of the Save As dialog box that switches between Browse Folders and Hide Folders when clicked.

FOS_FORCEPREVIEWPANEON (0x40000000)

Indicates to the Open dialog box that the preview pane should always be displayed.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Community Additions

ADD
© 2013 Microsoft. All rights reserved.