Freigeben über


SetInputScope Function

SetInputScope Function

Introduction to SetInputScope function.

The SetInputScope function associates the specified window with one common input scope or one phrase list.

HRESULT SetInputScope(
    [in] HWND hwnd,
    [in] InputScope inputscope
);

Parameters

hwnd

HWND of the window to which you are assigning the input scope.

inputscope

The input scope being assigned. Must be one of the values of the InputScope enumeration.

Return Values

S_OK if the function succeeds; otherwise an error code.

Remarks

To remove the association between a window and an input scope, you must call SetInputScope with inputscope set to IS_DEFAULT before a window is destroyed.

The SetInputScope APIs are not thread safe. Only the thread that creates the control may call SetInputScope for the control.

Example Code

[C++]

The following code illustrates how to set an input scope for a window.

SetInputScope(hwnd, IS_EMAIL_USERNAME);

Windows XP: Included in Windows XP SP2.

Header: Declared in InputScope.idl and InputScope.h.

Library: Included as a resource in Msctf.dll.