ITfContext interface
The ITfContext interface is implemented by the TSF manager and used by applications and text services to access an edit context.
Members
The ITfContext interface inherits from the IUnknown interface. ITfContext also has these types of members:
Methods
The ITfContext interface has these methods.
| Method | Description |
|---|---|
| CreateRangeBackup |
Creates a backup of a range. |
| EnumProperties |
Obtains a document property enumerator. |
| EnumViews |
Not implemented. |
| GetActiveView |
Obtains the active view for the context. |
| GetAppProperty |
Obtains an application property. |
| GetDocumentMgr |
Obtains the document manager that contains the context. |
| GetEnd |
Obtains a range of text positioned at the end of the document. |
| GetProperty |
Obtains a text property. |
| GetSelection |
Obtains the selection within the document. |
| GetStart |
Obtains a range of text positioned at the beginning of the document. |
| GetStatus |
Obtains the document status. |
| InWriteSession |
Determines if a client has a read/write lock on the context. |
| RequestEditSession |
Obtains access to the document text and properties. |
| SetSelection |
Sets the selection within the document. |
| TrackProperties |
Obtains a special property that can enumerate multiple properties over multiple ranges. |
Remarks
An edit context object is created by calling ITfDocumentMgr::CreateContext. Often, a text service uses the currently active edit context. The currently active edit context is the edit context at the top of the stack of the active document manager.
Examples
HRESULT hr; ITfDocumentMgr *pFocusDoc; hr = pThreadMgr->GetFocus(&pFocusDoc); if(SUCCEEDED(hr)) { ITfContext *pContext; hr = pFocusDoc->GetTop(&pContext); if(SUCCEEDED(hr)) { //Use the context. pContext->Release(); } pFocusDoc->Release(); }
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Redistributable |
TSF 1.0 on Windows 2000 Professional |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also