IUICommandHandler Interface

The IUICommandHandler interface is implemented by the application and defines the methods for gathering Command information and handling Command events from the Windows Ribbon (Ribbon) framework.

IUICommandHandler Members

Execute Responds to execute events on Commands bound to the Command handler.
UpdateProperty Responds to property update requests from the Windows Ribbon (Ribbon) framework.

Remarks

For each Command in a View, the Ribbon framework requires a corresponding Command handler in the host application. A new handler or an existing handler must be bound to the Command through the IUIApplication::OnCreateUICommand notification method.

Any number of Commands can be bound to a Command handler.

The Command handler serves two purposes: respond to property update requests and respond to execute events on any Command to which it is bound.

Interface Information

Inherits fromIUnknown
Header and IDL filesuiribbon.h, uiribbon.idl
Import libraryuiribbon.dll
Minimum operating systems Windows 7, Windows Vista with Service Pack 2 (SP2) and Platform Update for Windows Vista, Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008

See Also

Windows Ribbon Framework Samples
Tags :


Community Content

Arik Poznanski
C# Syntax
// Command handler interface
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("75ae0a2d-dc03-4c9f-8883-069660d0beb6")]
public interface IUICommandHandler
{
// User action callback, with transient execution parameters
[PreserveSig]
HRESULT Execute(UInt32 commandId, // the command that has been executed
UI_ExecutionVerb verb, // the mode of execution
[In] ref PropertyKey key, // the property that has changed
[In] ref PropVariant currentValue, // the new value of the property that has changed
[MarshalAs(UnmanagedType.Interface)] IUISimplePropertySet commandExecutionProperties); // additional data for this execution

// Informs of the current value of a property, and queries for the new one
[PreserveSig]
HRESULT UpdateProperty(UInt32 commandId,
[In] ref PropertyKey key,
[In] ref PropVariant currentValue,
[In, Out] ref PropVariant newValue);
}
Tags : c# syntax

Page view tracker