Platform SDK: International Features |
The ImmSetCompositionString function sets the characters, attributes, and clauses of the composition and reading strings.
BOOL ImmSetCompositionString( HIMC hIMC, DWORD dwIndex, LPVOID lpComp, DWORD dwCompLen, LPVOID lpRead, DWORD dwReadLen );
Value | Meaning |
---|---|
SCS_SETSTR | Sets the composition string, the reading string, or both. At least one of the lpComp and lpRead parameters must point to a valid string. If either string is too long, the IME truncates it. |
SCS_CHANGEATTR | Sets attributes for the composition string, the reading string, or both. At least one of the lpComp and lpRead parameters must point to a valid attribute array. |
SCS_CHANGECLAUSE | Sets the clause information for the composition string, the reading string, or both. At least one of the lpComp and lpRead parameters must point to a valid clause information array. |
SCS_SETRECONVERTSTRING | Windows 98 and Windows 2000: Asks IME to reconvert the string by a specified RECONVERTSTRING structure. |
SCS_QUERYRECONVERTSTRING | Windows 98 and Windows 2000: Asks IME to adjust the RECONVERTSTRING structure. Then the application can pass the adjusted RECONVERTSTRING structure into this API with SCS_SETRECONVERTSTRING. IME will not generate any WM_IME_COMPOSITION messages. |
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
The application can set lpComp, lpRead or both. If the application does not specify lpComp, lpComp must be NULL and dwCompLen must be zero.
When changing attributes, all characters in a clause must have the same attribute. Converted characters must be either ATTR_CONVERTED or ATTR_TARGET_CONVERTED; unconverted characters either ATTR_INPUT or ATTR_TARGET_NOTCONVERTED.
When changing clause information, only the target clause can be changed and only one boundary of the clause can be changed at a time. The target clause has the ATTR_TARGET_CONVERTED or ATTR_TARGET_NOTCONVERTED attribute.
For more information about attributes (ATTR_* values), see Composition String.
When the IME completes the changes, it sends a WM_IME_COMPOSITION message to the application notifying it of the changes.
Windows 98 and Windows 2000: The SCS_*CONVERTSTRING values are used for reconversion. They can only be used for an IME that has the SCS_CAP_SETRECONVERTSTRING property. They are used as follows: First, call ImmSetCompositionString() with SCS_QUERYRECONVERTSTRING so that IME adjusts the RECONVERTSTRING structure for the reconversion. Then, call ImmSetCompositionString() with SCS_SETRECONVERTSTRING so that IME generates a new composition string. After this, lpComp and lpRead will point to a RECONVERTSTRING structure that contains the updated composition and reading string. lpRead can be used only when the selected IME has SCS_CAP_MAKEREAD set. lpRead can be NULL.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Imm.h.
Library: Use Imm32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Input Method Editor Overview, Input Method Editor Functions, WM_IME_COMPOSITION, RECONVERTSTRING