ITextStoreACP2::InsertTextAtSelection method (textstor.h)

Inserts text at the insertion point or selection. A caller must have a read/write lock on the document before inserting text.

Syntax

HRESULT InsertTextAtSelection(
  [in]  DWORD         dwFlags,
  [in]  const WCHAR   *pchText,
  [in]  ULONG         cch,
  [out] LONG          *pacpStart,
  [out] LONG          *pacpEnd,
  [out] TS_TEXTCHANGE *pChange
);

Parameters

[in] dwFlags

[in] pchText

[in] cch

[out] pacpStart

[out] pacpEnd

[out] pChange

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The values of the pacpStart and the pacpEnd parameters depend upon how the client application inserts text into a document. For example, if the application sets the cursor at the start of the inserted text after text insertion, then the value for the pacpStart and pacpEnd parameters is the same as the acpStart member of the TS_TEXTCHANGE structure.

Applications should not call the OnTextChange method in response to this method.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header textstor.h
DLL Msctf.dll

See also

Compositions

ITextStoreACP2

OnTextChange

TF_IAS_* Constants

TS_TEXTCHANGE