我的程序是全屏的,看不到系统的Title Bar中显示的当前输入法图标,所以我想自己实现这个功能。
首先,我想就在右上角一块画上输入法对应的字符串,所以我的第一个问题就是如何得到当前输入法的名称,
第二,系统在输入法发生改变时会不会发出的事件?
谢谢!
------解决方案--------------------
Edit_GetInputMode
This function obtains the input mode of the current window.
int Edit_GetInputMode(
HWND hwndCtl,
BOOL fActual);
Parameters
hwndCtl
The window for which the input mode will be obtained.
fActual
A Boolean value indicating which input mode is retrieved. Value Description
1 (True) Retrieves the actual input mode if the window has focus, otherwise retrieves the default input mode.
0 (False) Retrieves the default input mode.
Return Values
EIM_SPELL
Spell input mode.
EIM_AMBIG
Ambiguous mode if input engine supports this mode, otherwise defaults to Spell input mode.
EIM_NUMBERS
Numbers mode.
EIM_TEXT
The user's preferred mode. This is the user's last Spell or Ambiguous mode selection in an EIM_TEXT edit control.
EIM_MASK
Mask to access mode.
EIM_MODE(x)
Macro to access mode.
EIMMF_SETCLR_SHIFT
In. Used to set/clear Shift.
EIMMF_SETCLR_CAPSLOCK
In. Used to set/clear CapsLock.
EIMMF_SHIFT
In/Out. Shift state.
EIMMF_CAPSLOCK
In/Out. CapsLock state.
EIMMF_MASK
Mask to access modifier flags.
EIM_MODIFIERS(x)
Macro to access modifier flags.
------解决方案--------------------
用不着那么复杂哦
第一个问题
1. 获取输入法
在左侧工具箱拉格InputPanel控件,该控件有个CurrentInputMethod方法可以获取或设置当前输入法
inputPanel1.CurrentInputMethod
第二个问题
cnblogs已经有人实现了我把链接给你
http://www.cnblogs.com/nsnail/archive/2007/12/25/1014356.html