IUIFramework::SetUICommandProperty method (uiribbon.h)

Sets a command property, value, or state.

Syntax

HRESULT SetUICommandProperty(
  [in] UINT32         commandId,
  [in] REFPROPERTYKEY key,
  [in] REFPROPVARIANT value
);

Parameters

[in] commandId

Type: UINT32

The ID for the Command, which is specified in the Markup resource file.

[in] key

Type: REFPROPERTYKEY

The property key of the command property, value, or state.

[in] value

Type: PROPVARIANT

The property, value, or state.

Return value

Type: HRESULT

Returns S_OK if successful, otherwise an error value from the following list.

Value Description
HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) The property, value, or state does not support IUIFramework::SetUICommandProperty. They may support being set through invalidation only.
E_FAIL The operation failed.

Remarks

A limited number of property keys can be set using IUIFramework::SetUICommandProperty. For those properties where IUIFramework::SetUICommandProperty returns HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), IUIFramework::InvalidateUICommand should be used instead.

For more information on how to set a property key for a specific control, see the Windows Ribbon Framework Control Library page for that control.

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 uiribbon.h
DLL Mshtml.dll

See also

IUIFramework

Windows Ribbon Framework Samples