Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

OleTranslateAccelerator function

Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table.

Syntax


HRESULT OleTranslateAccelerator(
  _In_  LPOLEINPLACEFRAME lpFrame,
  _In_  LPOLEINPLACEFRAMEINFO lpFrameInfo,
  _In_  LPMSG lpmsg
);

Parameters

lpFrame [in]

Pointer to the IOleInPlaceFrame interface to which the keystroke might be sent.

lpFrameInfo [in]

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

lpmsg [in]

Pointer to an MSG structure containing the keystroke.

Return value

This function returns S_OK on success. Other possible values include the following.

Return codeDescription
E_FAIL

The object should continue processing this message.

 

Remarks

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.

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

IsAccelerator
IOleInPlaceFrame::TranslateAccelerator

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.