OPENFILENAMEEX
4/8/2010
This structure contains information used to initialize the GetOpenFileNameEx function.
Syntax
typedef struct tagOPENFILENAMEEX {
DWORD lStructSize;
HWND hwndOwner;
HINSTANCE hInstance;
LPCSTR lpstrFilter;
LPSTR lpstrCustomFilter;
DWORD nMaxCustFilter;
DWORD nFilterIndex;
LPSTR lpstrFile;
DWORD nMaxFile;
LPSTR lpstrFileTitle;
DWORD nMaxFileTitle;
LPSTR lpstrInitialDir;
LPCSTR lpstrTitle;
DWORD Flags;
WORD nFileOffset;
WORD nFileExtension;
LPCSTR lpstrDefExt;
DWORD lCustData;
LPOFNHOOKPROC lpfnHook;
LPCSTR lpTemplateName;
OFN_EXFLAG ExFlags;
OFN_SORTORDER dwSortOrder;
} OPENFILENAME, *LPOPENFILENAME;
Members
- lStructSize
The size of this structure, in bytes.
- hwndOwner
A handle to the owner window.
- hInstance
Handle to the module whose executable file contains the dialog box.
- lpstrFilter
When ExFlags has the OFN_EXFLAG_THUMBNAILVIEW bit on and lpstrFilter is NULL, dialog displays all image file types supported by the system.
- lpstrCustomFilter
Not supported.
- nMaxCustFilter
Not supported.
nFilterIndex
Specifies the index of the currently selected filter in the File Types control. The buffer pointed to by lpstrFilter contains pairs of strings that define the filters. The first pair of strings has an index value of 1, the second pair 2, and so on. You can specify an index on input to indicate the initial filter description and filter pattern for the dialog box. When the user selects a file, nFilterIndex returns the index of the currently displayed filter.If nFilterIndex is zero, the system uses the first filter in the lpstrFilter buffer.
lpstrFile
Long pointer to a buffer that contains a file name used to initialize the File Name edit control. The first character of this buffer must be NULL if initialization is not necessary. When the GetOpenFileNameEx function returns successfully, this buffer contains the drive designator, path, file name, and extension of the selected file.If the buffer is too small, the function returns FALSE. In this case, the first two bytes of the lpstrFile buffer contain the required size, in bytes or characters.
- nMaxFile
Specifies the size, in bytes (ANSI version) or 16-bit characters (Unicode version), of the buffer pointed to by lpstrFile. The GetOpenFileNameEx function will return FALSE if the buffer is too small to contain the file information. The buffer should be at least 256 characters long.
- lpstrFileTitle
Long pointer to a buffer that receives the file name and extension (without path information) of the selected file. This member can be NULL.
- nMaxFileTitle
Specifies the size, in bytes (ANSI version) or 16-bit characters (Unicode version), of the buffer pointed to by lpstrFileTitle. This member is ignored if lpstrFileTitle is NULL.
- lpstrInitialDir
When ExFlags has the OFN_EXFLAG_THUMBNAILVIEW bit on and lpstrInitialDir is NULL, dialog defaults to "%MyDocuments%\My Pictures", where %MyDocuments%\My PICTURES is theCSIDL_MYPICTURES
special folder
- lpstrTitle
When InitialView is FVM_THUMBNAIL and lpstrTitle is NULL, dialog title defaults to 'Select a Picture'.
- Flags
A bitmask of flags used to initialize the dialog box.
- nFileOffset
Specifies the zero-based offset, in bytes (ANSI version) or 16-bit characters (Unicode version), from the beginning of the path to the file name in the string pointed to by lpstrFile. For example, if lpstrFile points to the following string, c:\dir1\dir2\file.ext, this member contains the value 13 to indicate the offset of the file.ext string.
- nFileExtension
Specifies the zero-based offset, in bytes (ANSI version) or 16-bit characters (Unicode version), from the beginning of the path to the file name extension in the string pointed to by lpstrFile. For example, if lpstrFile points to the following string, c:\dir1\dir2\file.ext, this member contains the value 18. If the user did not type an extension and lpstrDefExt is NULL, this member specifies an offset to the terminating null character. If the user typed "." as the last character in the file name, this member specifies zero.
- lpstrDefExt
Long pointer to a buffer that contains the default extension. GetOpenFileNameEx appends this extension to the file name if the user fails to type an extension. This string can be any length, but only the first three characters are appended. The string should not contain a period (.). If this member is NULL and the user fails to type an extension, no extension is appended.
- lCustData
Not supported.
- lpfnHook
Not supported.
- lpTemplateName
Not supported.
ExFlags
A bitmask of flags used to initialize the dialog. The following table shows the values, with a description of each value.Value Description OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEODEFAULT
Launch the camera in video mode without changing the audio setting.
This setting is mutually exclusive with:
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOONLY
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOWITHAUDIO
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOONLY
Launch the camera in video mode and disable audio recording. The user can enable the audio in options dialog.
Since audio settings are shared between GetOpenFileNameEx and pimg.exe (the picture viewer application), changing the audio settings here will affect pimg.exe as well.
This setting is mutually exclusive with:
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEODEFAULT
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOWITHAUDIO
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOWITHAUDIO
Launch the camera in video mode and enable audio recording. The user can disable audio in the options dialog.
Since audio settings are shared between GetOpenFileNameEx and pimg.exe (the picture viewer application), changing the audio settings here will affect pimg.exe as well.
This setting is mutually exclusive with:
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEODEFAULT
OFN_EXFLAG_CAMERACAPTURE_MODE_VIDEOONLY
OFN_EXFLAG_DETAILSVIEW
Displays the listview in Details format.
OFN_EXFLAG_EXPLORERVIEW
Displays the listview in Explorer format.
OFN_EXFLAG_HIDEDRMFORWARDLOCKED
When this flag is set, indicates that Forward Locked content is not displayed in the Picture Picker.
OFN_EXFLAG_HIDEDRMPROTECTED
If this flag is set, indicates that DRM-protected files are not displayed in the Picture Picker.
OFN_EXFLAG_MESSAGING_FILE_CREATE
Only show picture resolutions or video profiles that are tagged as messaging types.
OFN_EXFLAG_THUMBNAILVIEW
Displays the listview in Thumbnails format
dwSortOrder
Specifies the initial sort order. dwSortOrder is currently only supported when ExFlags has the OFN_EXFLAG_THUMBNAILVIEW bit on. The following table shows the values, with a description of each value.Value Description OFN_SORTORDER_AUTO
Sort order is implementation-dependent.
OFN_SORTORDER_DATE
Sort order is date descending. dwSortOrder defaults to this value when ExFlags is OFN_EXFLAG_THUMBNAILVIEW
OFN_SORTORDER_NAME
Sort order is dependent on name.
OFN_SORTORDER_SIZE
Sort order is dependent on size.
Requirements
Header | aygshell.h |
Windows Mobile | Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later |