Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This function will pass the SHIME_MODEvalue to the IME if the IME is present, or it will pass the SHIME_MODEinfo to the keyboard driver if the IME is disabled.

Syntax

HRESULT SHSetImeMode(
	HWND 
hWnd
	SHIME_MODE 
nMode
);

Parameters

hWnd

[in] Handle to the window whose IME mode is to be changed. If the window handle is NULL then only keyboard driver will be notified.

nMode

[in] It is one of SHIME_MODEvalues.

Return Value

Returns S_OK if successful. Any other return value indicates failure.

Remarks

Drivers for 12-key keyboards will ignore the IME mode since there is only one keyboard state.

An IME that supports a QWERTY keyboard should notify the keyboard driver of the desired IME mode.

Applications that are not IME-aware should call SHSetImeModeto set the IME mode to the desired input mode when they gain focus and should call SHSetImeModeagain to set the IME mode to SHIME_MODE_NONE when they lose focus.

If the window handle hWndis not from caller's process and IME is enabled, both SHSetImeModeand SHGetImeModewill fail.

See Also

Reference

Shell Functions