# IOleControl::OnMnemonic

Informs a control that the user has pressed a keystroke that matches one of the ACCEL entries in the mnemonic table returned through IOleControl::GetControlInfo. The control takes whatever action is appropriate for the keystroke.

HRESULT OnMnemonic(

LPMSG pMsg | //Pointer to structure
); |

Parameters

pMsg
  [in] Pointer to the MSG structure describing the keystroke to be processed.

Return Values

This method supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following:

S_OK
  The control accepted the mnemonic.
E_NOTIMPL
  The control doesn’t handle any mnemonics. This indicates an unexpected condition and a caller error. For example, the caller has mismatched which control has which mnemonic.

Remarks

#### Notes to Implementers

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

#### 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.

See Also

IOleControl::GetControlInfo, IOleControlSite::OnControlInfoChanged