IFileDialog::SetDefaultExtension method

Sets the default extension to be added to file names.

Syntax


HRESULT SetDefaultExtension(
  [in] LPCWSTR pszDefaultExtension
);

Parameters

pszDefaultExtension [in]

Type: LPCWSTR

A pointer to a buffer that contains the extension text. This string should not include a leading period. For example, "jpg" is correct, while ".jpg" is not.

Return value

Type: HRESULT

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

Remarks

If this method is called before showing the dialog, the dialog will update the default extension automatically when the user chooses a new file type (see SetFileTypes).

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

 

 

Show: