IUIApplication::OnDestroyUICommand method (uiribbon.h)

Called for each Command specified in the Windows Ribbon framework markup when the application window is destroyed.

Syntax

HRESULT OnDestroyUICommand(
  [in]           UINT32            commandId,
  [in]           UI_COMMANDTYPE    typeID,
  [in, optional] IUICommandHandler *commandHandler
);

Parameters

[in] commandId

Type: UINT32

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

[in] typeID

Type: UI_COMMANDTYPE

The Command type that is associated with a specific control.

[in, optional] commandHandler

Type: IUICommandHandler*

A pointer to an IUICommandHandler object. This value can be NULL.

Return value

Type: HRESULT

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

Remarks

This callback notification is sent by the Ribbon framework to the host application for each Command declaration in the markup resource file.

All resources in the host application associated with each Command are released.

Examples

The following example demonstrates a basic implementation of the IUIApplication::OnDestroyUICommand method.

//
//  FUNCTION:    OnDestroyUICommand(UINT, UI_COMMANDTYPE, IUICommandHandler*)
//
//  PURPOSE:    Called for each Command specified in the Ribbon markup 
//                when the Ribbon host application window is destroyed.
//
//  PARAMETERS:    
//                nCmdID - The Command identifier. 
//                typeID - The Command type. 
//                commandHandler - The Command handler. 
//
//  COMMENTS:
//
//
STDMETHODIMP CApplication::OnDestroyUICommand(
    UINT32 nCmdID,
    UI_COMMANDTYPE typeID,
    IUICommandHandler* commandHandler)
{
    return E_NOTIMPL;
}

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

IUIApplication

Windows Ribbon Framework Samples