OleTranslateAccelerator

Called by the object application, allowing the container to translate its accelerators pointed to by lpFrameInfo.

HRESULT OleTranslateAccelertor(

LPOLEINPLACEFRAME lpFrame,
//Possible location to send keystrokes
LPOLEINPLACEFRAMEINFO lpFrameInfo,
//Accelerator table obtained from container
LPMSG lpmsg
//Structure containing the keystroke
);

Parameters

lpFrame

Points to the IOleInPlaceFrame interface where the keystroke might be sent.

lpFrameInfo

Points to an OLEINPLACEFRAMEINFO structure containing the accelerator table obtained from the container.

lpmsg

Points to an MSG structure containing the keystroke.

Return Values

S_OK

Indicates the keystroke was processed.

S_FALSE

Indicates the object should continue processing this message.

E_INVALIDARG

Indicates one of the arguments is invalid.

E_UNEXPECTED

Indicates an unexpected error occurred.

Comments

While an object is UI active, it always has first chance at translating any messages received. If the object does not want to translate the message, it calls OleTranslateAccelerator to give the container a chance. If the keyboard input matches an accelerator found in the container-provided accelerator table, OleTranslateAccelerator passes the message and its command identifier on to the container through the IOleInPlaceFrame::TranslateAccelerator method. This method returns S_OK if the keystroke is consumed; otherwise it returns S_FALSE.

The OleTranslateAccelerator function is intended to be called only by local server object applications and not by in-process server objects. In the case of a local server object application, keyboard input goes directly to the object application's message pump. If the object does not translate the key, OleTranslateAccelerator gives the container application an opportunity to do it. In the case of an in-process server object, the keyboard input goes directly to the container's message pump.

Note Accelerator tables for containers should be defined so they will work properly with object applications that do their own accelerator keystroke translations. These tables should take the form:

"char", wID, VIRTKEY, CONTROL

This is the most common way to describe keyboard accelerators. Failure to do so can result in keystrokes being lost or sent to the wrong object during an in-place session.

Objects can call the IsAccelerator function to see whether the accelerator keystroke belongs to the object or the container.

See Also

IsAccelerator, IOleInPlaceFrame::TranslateAccelerator

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database