GetFilename (Windows CE 5.0)
This method is called by MSHTML to retrieve the filename from the Open or the Save dialog box within the host.
HRESULT GetFilename( BOOL fSave, HWND hwnd, DWORD idFilterRes, LPOLESTR lpstrFileName, DWORD cchFile, long lCustData);
Parameters
- fSave
[in] Set this value to TRUE for the SaveAs dialog box, or to FALSE for the Open dialog box. - hwnd
[in] Specifies the handle to the host window. - idFilterRes
[in] Specifies the resource identifier of the filter string. - lpstrFileName
[in, out] Pointer to a VT_BSTR that contains the name of the file. - cchFile
[in] Specifies the length of the filename buffer. - lCustData
[in] Reserved.
Return Values
If the user chooses OK in the dialog box, returns S_OK. If the user chooses Cancel, this method should return S_FALSE.
Remarks
The format string for GetFilename is delimited by '|'. The following code example shows a formatted string, IDS_HTMLFORM_SAVE.
IDS_HTMLFORM_SAVE
"Save HTML Document|
htm|
HTML File (*.htm;*.html)|*.htm;*.html|Text File (*.txt)|*.txt|"
The first value specifies the title of the dialog box. The second value in the string specifies the default file extension. The remaining values indicate filter strings.
You can choose not to use any dialog box by returning S_FALSE. The following code example shows how to do this.
HRESULT MyContainer::GetFilename(BOOL fSave, HWND hwnd, DWORD idFilterRes, LPOLESTR lpstrFileName, DWORD cchFile, long lCustData)
{
return S_FALSE;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Mshtmhst.h, Mshtmhst.idl.
See Also
Replacement of the MSHTML User Interface | IDocHostShowUICE:IUnknown
Send Feedback on this topic to the authors