Share via


IIMCallback3::GetInputContext (Compact 2013)

3/28/2014

This method retrieves input context from the software-based input panel (SIP) driver when it is called by the input method.

Syntax

HRESULT GetInputContext(
  DWORD dwType, 
  LPBYTE lpData, 
  LPDWORD lpcbData
);

Parameters

  • dwType
    [in] Type of input context. An input context stores information about the status of the Input Method Editor (IME). Accepted values are INPUTCONTEXT_INPUTSCOPES (to retrieve current focused window input scopes) or INPUTCONTEXT_INPUTLANGUAGE (to retrieve current input language).
  • lpData
    [out] Input context retrieved. The value depends on the value of dwType. If dwType is INPUTCONTEXT_INPUTSCOPES, lpData is a type of pointer to the InputScope that is the array pointer to the input scopes of the window currently in focus. The SIP will allocate enough space for lpData to retrieve the input scopes data.
    If dwType is INPUTCONTEXT_INPUTLANGUAGE, lpData is the pointer to the locale identifier (LCID).
    This parameter can be NULL. When it is NULL, only the size pointed to by lpcbData determines the data size allocated for the buffer pointed to by lpData.
  • lpcbData
    [in][out] Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpData parameter. When the method returns, the variable contains the size of the data copied to the buffer pointer to by lpData.
    The value depends on the value of dwType. If dwType is INPUTCONTEXT_INPUTSCOPES, the value pointed by lpcbData is the count of input scopes multiplied by the size of InputScope.
    If dwType is INPUTCONTEXT_INPUTLANGUAGE, the value pointed by lpcbData equals the size of the LCID.

Return Value

The following table shows the possible return values.

Value

Description

S_OK

Success.

E_INVALIDARG

Invalid method parameter.

E_OUTOFMEMORY

Failed to allocate memory to retrieve input context.

E_FAIL

Other failure. To get more information, call GetLastError.

Remarks

To retrieve current input scopes, the SIP calls this method with lpData as NULL first, using the data size retrieved by lpcbData to allocate enough memory for holding InputScopes. The SIP then calls this method with sufficient memory allocated for the buffer pointed to by lpData.

Requirements

Header

sip.h

Library

uuid.lib

sysgen

SYSGEN_SOFTKB

See Also

Reference

IIMCallback3
IIMCallback3::SendAlternatives2
IIMCallback3::SendCharEvents
IIMCallback3::SendString
IIMCallback3::SendVirtualKey
IIMCallback3::SetImInfo