开关输入法的代码在win8.1(64位)下无效

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

aamii
Posts: 47
Joined: 23 May 2014, 03:50

开关输入法的代码在win8.1(64位)下无效

02 Jul 2015, 07:57

下面两个函数,切换输入法的中英文状态
以前在win7(32位)+Ahk32_Unicode 下面,操作稳定。
转移到Win8.1(64位)+Ahk64_unicode下,针对“本脚本”不能用,测试中发现似乎对第三方窗口还是有效。
麻烦谁帮看下,谢了。

Code: Select all

imeon()
InputBox,aa
MsgBox
imeoff()
InputBox,nn

imeoff(shwnd="A_ScriptHwnd")
{
  DllCall("SendMessage" , UInt, DllCall("imm32\ImmGetDefaultIMEWnd", Uint,shwnd), UInt, 0x0283   ,  Int, 0x002  ,  Int, 0x00)   ;切换到英文状态
}
imeon(shwnd="A_ScriptHwnd")
{
  DllCall("SendMessage" , UInt, DllCall("imm32\ImmGetDefaultIMEWnd", Uint,shwnd), UInt, 0x0283   ,  Int, 0x002  ,  Int, 0x01)   ;输入法问题
}
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: 开关输入法的代码在win8.1(64位)下无效

02 Jul 2015, 08:27

win7 64位 + U32/U64 测试没有问题。

Code: Select all

imeon()
InputBox,aa ; 弹出输入框时手工切换到中文输入状态
MsgBox
imeoff()
InputBox,nn ; 这里变成了英文输入状态了
aamii
Posts: 47
Joined: 23 May 2014, 03:50

Re: 开关输入法的代码在win8.1(64位)下无效

03 Jul 2015, 07:03

感谢tmp的测试,估计与win8有关

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 81 guests