IsAccelerator function (ole2.h)

Determines whether the specified keystroke maps to an accelerator in the specified accelerator table.

Syntax

BOOL IsAccelerator(
  [in]  HACCEL hAccel,
  [in]  int    cAccelEntries,
  [in]  LPMSG  lpMsg,
  [out] WORD   *lpwCmd
);

Parameters

[in] hAccel

A handle to the accelerator table.

[in] cAccelEntries

The number of entries in the accelerator table.

[in] lpMsg

A pointer to the keystroke message to be translated.

[out] lpwCmd

A pointer to a variable to receive the corresponding command identifier if there is an accelerator for the keystroke. This parameter may be NULL.

Return value

If the message is for the object application, the return value is TRUE. If the message is not for the object and should be forwarded to the container, the return value is FALSE.

Remarks

While an object is active in-place, the object always has first chance to translate the keystrokes into accelerators. If the keystroke corresponds to one of its accelerators, the object must not call the OleTranslateAccelerator function - even if its call to the TranslateAccelerator function fails. Failure to process keystrokes in this manner can lead to inconsistent behavior.

If the keystroke is not one of the object's accelerators, then the object must call OleTranslateAccelerator to let the container try its accelerator translation.

The object's server can call IsAccelerator to determine if the accelerator message belongs to it. Some servers do accelerator translation on their own and do not call TranslateAccelerator. Those applications will not call IsAccelerator, because they already have the information.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole2.h
Library Ole32.lib
DLL Ole32.dll

See also

OleTranslateAccelerator

TranslateAccelerator