Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table.
WINOLEAPI OleTranslateAccelerator(
LPOLEINPLACEFRAME lpFrame,
//Pointer to send keystrokes
LPOLEINPLACEFRAMEINFO lpFrameInfo,
//Pointer to accelerator table obtained from container
LPMSG lpmsg //Pointer to structure containing the keystroke
);
This function supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following:
Object servers call OleTranslateAccelerator to allow the object's container to translate accelerator keystrokes according to the container's accelerator table, pointed to by lpFrameInfo. While a contained object is the active object, the object's server always has first chance at translating any messages received. If this is not desired, the server calls OleTranslateAccelerator to give the object's 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.
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.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ole2.h.
Import Library: Included as a resource in ole32.dll.
IsAccelerator, IOleInPlaceFrame::TranslateAccelerator