ITfDocumentMgr::Pop method (msctf.h)

Removes the context from the top of the context stack.

Syntax

HRESULT Pop(
  [in] DWORD dwFlags
);

Parameters

[in] dwFlags

If this value is 0, only the context at the top of the stack is removed. If this value is TF_POPF_ALL, all of the contexts are removed from the stack.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_FAIL
The stack is empty or this method is called without the TF_POPF_ALL flag and only a single context is on the stack.
E_UNEXPECTED
This method was called during another ITfDocumentMgr::Pop call.
E_INVALIDARG
dwFlags is invalid.

Remarks

This method must be called from the same thread as the corresponding ITfDocumentMgr::Push call.

The first context added to the stack becomes the primary context. The primary context cannot be removed from the stack without using the TF_POPF_ALL flag. When the document is uninitialized, this method should be called with the TF_POPF_ALL flag. This causes the document manager to remove all contexts from the context stack and terminate any text service UI. Do not use the TF_POPF_ALL flag at any other time.

This method causes the ITfThreadMgrEventSink::OnPopContext method of all installed thread manager event sinks to be called. If the last context is removed from the stack, this method causes the ITfThreadMgrEventSink::OnUninitDocumentMgr method of all installed thread manager event sinks to be called.

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

ITfDocumentMgr

ITfDocumentMgr::Push

ITfThreadMgrEventSink::OnPopContext

ITfThreadMgrEventSink::OnUninitDocumentMgr