100分求解WIN2000下输入法的问题!
WIN98下用API函数实现,如下(嘿嘿,COPY):
声明API函数:
function boolean ImmSimulateHotKey (ULong hWnd, ULong dwHotKeyID) library "IMM32.dll"
function ulong GetKeyboardLayout(ulong dwLayout) LIBRARY "user32.dll"
function boolean ImmIsIME(uLong hklKeyboardLayout) library "IMM32.DLL"
定义变量:
constant int IME_THotKey_IME_NonIME_Toggle=112
ulong hklCurrent
ulong hnd
切换到英文输入法:
hklCurrent=GetKeyboardLayout(0)
if ImmIsIME(hklCurrent) then
hnd=Handle(parent)
ImmSimulateHotKey(hnd,IME_THotKey_IME_NonIME_Toggle)
end if
切换到中文输入法:
hklCurrent=GetKeyboardLayout(0)
if not ImmIsIME(hklCurrent) then
hnd=Handle(parent)
ImmSimulateHotKey(hnd,IME_THotKey_IME_NonIME_Toggle)
end if
但在WIN2000下上述办法好象不行,求教!另外其他输入法(如五笔)如何切换?谢谢!