PB自动切换输入法
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.定义外部引用函数
a)function boolean ImmSimulateHotKey (ULong hWnd, ULong dwHotKeyID) library
"IMM32.dll"
b)function ulong GetKeyboardLayout(ulong dwLayout) LIBRARY "user32.dll"
c)function boolean ImmIsIME(uLong hklKeyboardLayout) library "IMM32.DLL"
2.定义变量
a)constant int IME_THotKey_IME_NonIME_Toggle=16 //网络上大多使用112,
但是无效
b)ulong hklCurrent
c)ulong hnd
d)boolean ib_yijian
3.构建函数of_ime 参数long al_handle boolean ab_switch
a)Long ll_KeyLayout
b)ll_KeyLayout = GetKeyboardLayout(0)
c)If ab_switch Then
d)//切换到中文输入法
e)If Not ImmIsIME(ll_KeyLayout) Then
f)ImmSimulateHotKey(al_handle,IME_THotKey_IME_NonIME_Toggle)
g)End If
h)Else
i)//切换到英文输入法
j)If ImmIsIME(ll_KeyLayout) Then
k)ImmSimulateHotKey(al_handle,IME_THotKey_IME_NonIME_Toggle)
l)End If
m)End If
4.调用函数
a)parent.of_ime(Handle(This),false) 英文
b)parent.of_ime(Handle(This),True) 中文