Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ITfDocumentMgr::Push method

Syntax


HRESULT Push(
  [in] ITfContext *pic
);

Parameters

pic [in]

Pointer to the ITfContext object to be added to the stack. This object is obtained from a previous call to ITfDocumentMgr::CreateContext.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_INVALIDARG

pic is invalid.

TF_E_STACKFULL

No space exists on the stack for the context. The context stack has a limit of two contexts.

E_UNEXPECTED

This method was called during an ITfDocumentMgr::Pop call.

 

Remarks

The first context added to the stack becomes the main document context.

The TSF manager and text services only interact with the context at the top of the stack. Normally, only the main document context is on the stack. Occasionally, it is necessary to add a second context to the stack. For example, when a text service must display a modal UI, such as a candidate list. During this time, the text service will add its context to the stack. When the text service UI is no longer required, the text service removes the context from the stack. The main context then returns to the top of the stack. To simplify this process and prevent multiple modal UIs from being displayed, there is a maximum of two contexts allowed on the stack.

This method causes the ITfThreadMgrEventSink::OnPushContext method of all installed thread manager event sinks to be called. If this is the first context to be added to the stack, this method causes the ITfThreadMgrEventSink::OnInitDocumentMgr method of all installed thread manager event sinks to be called.

ITfDocumentMgr::Pop must be called to remove this context from the context stack.

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

Msctf.h

IDL

Msctf.idl

DLL

Msctf.dll

See also

ITfDocumentMgr
ITfContext
ITfDocumentMgr::CreateContext
ITfDocumentMgr::Pop
ITfThreadMgrEventSink::OnInitDocumentMgr
ITfThreadMgrEventSink::OnPushContext

 

 

Community Additions

Show:
© 2015 Microsoft