IFileDialog2::SetCancelButtonLabel method (shobjidl.h)

Replaces the default text "Cancel" on the common file dialog's Cancel button.

Syntax

HRESULT SetCancelButtonLabel(
  [in] LPCWSTR pszLabel
);

Parameters

[in] pszLabel

Type: LPCWSTR

Pointer to a string that contains the new text to display on the button.

Return value

Type: HRESULT

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

Remarks

Changing the text on the Cancel button can be useful for situations where the IFileDialogEvents::OnFileOk method is used to accumulate items, and the button text should be Done instead of Cancel, for example.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header shobjidl.h
Library Comdlg32.lib
DLL Comdlg32.dll (version 6.1 or later)

See also

IFileDialog2