IOleControl::OnMnemonic method

Informs a control that the user has pressed a keystroke that represents a keyboard mneumonic.

Syntax


HRESULT OnMnemonic(
  [in] MSG *pMsg
);

Parameters

pMsg [in]

A pointer to the MSG structure describing the keystroke to be processed.

Return value

This method can return the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following values.

Return codeDescription
S_OK

The method completed successfully.

E_NOTIMPL

The control does not handle mnemonics. This indicates an unexpected condition and a caller error. For example, the caller has mismatched which control has which mnemonic.

 

Remarks

The keystroke must match one of the ACCEL entries in the mnemonic table returned through IOleControl::GetControlInfo. The control takes whatever action is appropriate for the keystroke.

Notes to Callers

A container of a control is allowed to cache the control's CONTROLINFO structure, provided that the container implements IOleControlSite::OnControlInfoChanged to know when it must update its cached information.

Notes to Implementers

If a control changes the contents of its CONTROLINFO structure, it must notify its container by calling IOleControlSite::OnControlInfoChanged.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OCIdl.h

IDL

OCIdl.idl

IID

IID_IOleControl is defined as B196B288-BAB4-101A-B69C-00AA00341D07

See also

IOleControl
IOleControlSite::OnControlInfoChanged

 

 

Show: