Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ITfContext::RequestEditSession method (msctf.h)
Obtains access to the document text and properties.
Syntax
HRESULT RequestEditSession(
[in] TfClientId tid,
[in] ITfEditSession *pes,
[in] DWORD dwFlags,
[out] HRESULT *phrSession
);
Parameters
[in] tid
Contains a TfClientId value that identifies the client to establish the edit session with.
[in] pes
Pointer to an ITfEditSession interface called to perform the edit session.
[in] dwFlags
Contains one or more of the following values.
| Value | Meaning |
|---|---|
|
The edit session can occur synchronously or asynchronously, at the discretion of the TSF manager. The manager will attempt to schedule a synchronous edit session for improved performance. This value cannot be combined with the TF_ES_ASYNC or TF_ES_SYNC values. |
|
The edit session must be synchronous or the request will fail (with TF_E_SYNCHRONOUS). This flag should only be used in documented situations (such as keystroke handling) where it can be expected to succeed. Otherwise the call will likely fail. This value cannot be combined with the TF_ES_ASYNCDONTCARE or TF_ES_ASYNC values. |
|
Requests read-only access to the context. |
|
Requests read/write access to the context. |
|
The edit session must be asynchronous or the request fails. This value cannot be combined with the TF_ES_ASYNCDONTCARE or TF_ES_SYNC values. |
[out] phrSession
Address of an HRESULT value that receives the result of the edit session request. The value received depends upon the type of edit session requested.
- If an asynchronous edit session is requested and can be established, receives TF_S_ASYNC.
- If a synchronous edit session is requested and cannot be established, receives TF_E_SYNCHRONOUS.
- If the TF_ES_READWRITE flag is specified and the document is read-only, receives TS_E_READONLY.
- If a synchronous edit session is established, receives the return value of the ITfEditSession::DoEditSession.
Return value
This method can return one of these values.
| Value | Description |
|---|---|
|
The method was successful. phrSession contains more result data for the method. |
|
The caller is within the context of another text service which already holds a lock. |
|
The context is not on a document stack. |
|
One or more parameters are invalid. |
|
A memory allocation failure occurred. |
Remarks
Pending asynchronous edit sessions are processed in the order received. Synchronous edit sessions are processed before any pending asynchronous edit sessions.
A text service can request an edit session within the context of an existing edit session, provided a write access session is not requested within a read-only session. Calls to this method within the context of an edit session established by another text service will fail with TF_E_LOCKED.
A synchronous read/write request will fail if made when processing one of the following notifications.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 2000 Professional [desktop apps | UWP apps] |
| Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
| Target Platform | Windows |
| Header | msctf.h |
| DLL | Msctf.dll |
| Redistributable | TSF 1.0 on Windows 2000 Professional |
See also
ITfContext interface, ITfEditSession interface, ITfStatusSink::OnStatusChange, ITfTextEditSink::OnEndEdit, ITfTextLayoutSink::OnLayoutChange
Feedback
Was this page helpful?
