IUIApplication::OnDestroyUICommand method

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

commandId [in]

Type: UINT32

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

typeID [in]

Type: UI_COMMANDTYPE

The Command type that is associated with a specific control.

commandHandler [in, optional]

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

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Product

Windows UI

Header

Uiribbon.h

IDL

Uiribbon.idl

DLL

Mshtml.dll

See also

IUIApplication
Windows Ribbon Framework Samples

 

 

Show: