Skip to content

Latest commit

 

History

History
213 lines (165 loc) · 6.01 KB

nf-textstor-itextstoreacp2-settext.md

File metadata and controls

213 lines (165 loc) · 6.01 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:textstor.ITextStoreACP2.SetText
ITextStoreACP2::SetText (textstor.h)
Sets the text selection to the supplied character positions.
ITextStoreACP2 interface [Text Services Framework]
SetText method
ITextStoreACP2.SetText
ITextStoreACP2::SetText
SetText
SetText method [Text Services Framework]
SetText method [Text Services Framework]
ITextStoreACP2 interface
acpNewEnd
acpOldEnd
acpStart
textstor/ITextStoreACP2::SetText
tsf.itextstoreacp2_settext
tsf\itextstoreacp2_settext.htm
TSF
a00b8273-1690-4cf5-899f-afcb1092bfe8
12/05/2018
ITextStoreACP2 interface [Text Services Framework],SetText method, ITextStoreACP2.SetText, ITextStoreACP2::SetText, SetText, SetText method [Text Services Framework], SetText method [Text Services Framework],ITextStoreACP2 interface, acpNewEnd, acpOldEnd, acpStart, textstor/ITextStoreACP2::SetText, tsf.itextstoreacp2_settext
textstor.h
Windows
Windows 8 [desktop apps \| UWP apps]
Windows Server 2012 [desktop apps \| UWP apps]
Textstor.idl
Msctf.dll
Windows
19H1
ITextStoreACP2::SetText
textstor/ITextStoreACP2::SetText
c++
APIRef
kbSyntax
COM
msctf.dll
ITextStoreACP2.SetText

ITextStoreACP2::SetText

-description

Sets the text selection to the supplied character positions.

-parameters

-param dwFlags [in]

If set to the value of TS_ST_CORRECTION, the text is a transform (correction) of existing content, and any special text markup information (metadata) is retained, such as .wav file data or a language identifier. The client defines the type of markup information to be retained.

-param acpStart [in]

Specifies the starting character position of the text to replace.

-param acpEnd [in]

Specifies the ending character position of the text to replace. This parameter is ignored if the value is 1.

-param pchText [in]

Specifies the pointer to the replacement text. The text string does not have to be NULL terminated, because the text character count is specified in the cch parameter.

-param cch [in]

Specifies the number of characters in the replacement text.

-param pChange [out]

Pointer to a TS_TEXTCHANGE structure with the following data.

Value Meaning
acpStart
The starting application character position before the text is inserted into the document.
acpOldEnd
The ending position before the text is inserted into the document. This value is the same as acpStart for an insertion point. If this value is different from acpStart, then text was selected prior to the text insertion.
acpNewEnd
The ending position after the text insertion occurred.

-returns

This method can return one of these values.

Value Description
S_OK
The method was successful.
TS_E_INVALIDPOS
The acpStart or acpEnd parameter is outside of the document text.
TS_E_NOLOCK
The caller does not have a read/write lock.
TS_E_READONLY
The document is read-only. Content cannot be modified.
TS_E_REGION
An attempt was made to modify text across a region boundary.

-remarks

Applications should start a composition by first using InsertTextAtSelection. SetText should be used only within an existing composition. If there is no active composition at the time SetText is called, the TSF manager creates a composition that lasts just long enough to wrap the call to SetText.

The acpStart and acpEnd character positions cannot be outside the document range.

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

This method should call the SetSelection method to select the text to be changed. After successfully executing the SetSelection method, this method then calls the InsertTextAtSelection method to perform the actual text change.

-see-also

Compositions

ITextStoreACP2

Miscellaneous Text Store Constants

OnTextChange

TS_TEXTCHANGE