ITextHost::TxGetAcceleratorPos method (textserv.h)

Requests the special character to use for the underlining accelerator character.

Syntax

HRESULT TxGetAcceleratorPos(
  LONG *pcp
);

Parameters

pcp

Type: LONG*

The character position of the character to underline. This variable is set by the text host. A character position of –1 (that is, negative one) indicates that no character should be underlined.

Return value

Type: HRESULT

The return value is S_OK.

Remarks

Accelerators allow keyboard shortcuts, or accelerator keys, to various UI elements (such as buttons). Typically, the shortcut character is underlined.

This method tells the text services object which character is the accelerator and thus should be underlined. Note that the text services object does not process accelerators; that is the responsibility of the host.

This method is typically only called if the TXTBIT_SHOWACCELERATOR bit is set in the text services object. See OnTxPropertyBitsChange.

Note  Any change to the text in the text services object results in the invalidation of the accelerator underlining. In this case, it is the host's responsibility to recalculate the appropriate character position and inform the text services object that a new accelerator is available.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header textserv.h
DLL Msftedit.dll

See also

Conceptual

ITextHost

OnTxPropertyBitsChange

Reference

Windowless Rich Edit Controls