次の方法で共有


GetFilename (Windows Embedded CE 6.0)

1/6/2010

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

Header mshtmhst.h, mshtmhst.idl
Windows Embedded CE Windows CE 5.0 and later

See Also

Concepts

IDocHostShowUICE:IUnknown
Replacement of the MSHTML User Interface