# IOleControl

The IOleControl interface provides the features for supporting keyboard mnemonics (GetControlInfo, OnMnemonic), ambient properties (OnAmbientPropertyChange), and events (FreezeEvents) in control objects.

##### When to Implement

Implement this interface for a control object to communicate with the control’s container, for example, when managing keyboard activity or obtaining the container’s ambient properties.

##### When to Use

A control container uses this interface to work with keyboard mnemonics, ambient properties, and events of a contained control object.

Methods in Vtable Order

IUnknown Methods | Description
QueryInterface | Returns pointers to supported interfaces.
AddRef | Increments reference count.
Release | Decrements reference count.

IOleControl Methods | Description
GetControlInfo | Fills in a CONTROLINFO structure with information about the control’s keyboard behavior.
OnMnemonic | Informs the control that the user has pressed a keystroke that the control specified through GetControlInfo. The control takes whatever action is appropriate for the keystroke.
OnAmbientPropertyChange | Informs an control that one or more of the container’s ambient properties has changed.
FreezeEvents | Indicates whether or not the container ignores or accepts events from the control.

See Also

IOleControlSite, ISimpleFrameSite