返回列表 发帖

[AU3基础] AU3注册表调整输入法,不重启立即生效。或关闭输入法,设某输入法为默认(已解决)

本帖最后由 你没有kii 于 2017-1-14 11:46 编辑

RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","1","REG_SZ","e0210804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","2","REG_SZ","00000804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","3","REG_SZ","e0200804")
直接切换输入法无效。但可以在输入法设置看到输入法已改变。
请问怎么样可以在不重启来实现。重载这些设置呢。

dllcall("user32.dll","long","LoadKeyboardLayout","str","e0200804","int",0x1)
在贴子搜到这个是用来立即激活输入法。但无法设为默认输入法,我找其它帖子也找不到立即关闭其它输入法的办法。

上面的有点小问题,看了这位的明白了http://www.autoitx.com/viewthread.php?tid=1253

$rr=dllcall("user32.dll","long","LoadKeyboardLayout","str","E0220804","int",0x2);呼叫拼音++
DllCall("user32.dll","int","UnloadKeyboardLayout","long",$rr[0]);关闭拼音++,注意这个$rr[0]
$rr1=dllcall("user32.dll","long","LoadKeyboardLayout","str","E0230804","int",0x2);呼叫拼音++
DllCall("user32.dll","int","UnloadKeyboardLayout","long",$rr1[0]);关闭拼音++,注意这个$rr[0]
;清除输入法布局
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","3","REG_SZ","e0210804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","2","REG_SZ","00000804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","1","REG_SZ","e0200804")
;添加输入法,RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","键名","数据类型",键值)

dllcall("user32.dll","long","LoadKeyboardLayout","str","e0200804","int",0x1)
dllcall("user32.dll","long","LoadKeyboardLayout","str","e0210804","int",0x2)
dllcall("user32.dll","long","LoadKeyboardLayout","str","00000804","int",0x3)
;立即激活输入法

TOP

Global  Const  $KeyboardLayouts="E0200804",$var1 = "E0230804"
DllCall("user32.dll","int","UnloadKeyboardLayout","long",$var1)
DllCall("user32.dll","int","UnloadKeyboardLayout","long",$KeyboardLayouts)
;清除某输入法布局

RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","3","REG_SZ","e0230804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","2","REG_SZ","00000804")
RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","1","REG_SZ","e0200804")
;添加输入法,RegWrite("HKEY_CURRENT_USER\Keyboard Layout\Preload","键名","数据类型",键值)

dllcall("user32.dll","long","LoadKeyboardLayout","str","e0230804","int",0x1)
dllcall("user32.dll","long","LoadKeyboardLayout","str","e0210804","int",0x2)
dllcall("user32.dll","long","LoadKeyboardLayout","str","00000804","int",0x3)
;立即激活输入法

最后多搜几个明白了。先清掉不需要的输入法。再添加注册表。再激活

TOP

回复 14# Alam
请问具体怎么操作呢?用dllcal做能做到吗还有调用什么函数

TOP

先读取或备份全部输入法注册表的项目.
接着删除,只保留你要设为默认的那个;
然后,激活.
最后回写别的输入法...
Hi ...

TOP

回复 12# austere


    搞 不定

TOP

论坛里有个改IP不用重启的源码,你具体搜下~  利用那个可以实现你的目的~

TOP

以上都没解决

TOP

试试这个两是干什么用的吧!我也没用过。
ImmDisableIME
ImmDisableLegacyIME

TOP

我只收集到安装输入法的,没有卸载输入法的,给你参考:
  1. DLLCALL("imm32.dll", "ptr", "ImmInstallIME", "str", @SYSTEMDIR & "\Filename.ime", "str", "中文 (简体) - 某某输入法")
复制代码

TOP

回复 6# chishingchan

DllCall("user32.dll","long","LoadKeyboardLayout","str","e0200804","int",1+0)
我有这个就可以直接弄出搜狗拼音。但是设置里面没有了。

TOP

回复 6# chishingchan

我用了AU3转成EXE文件运行。也是不行。

看其它地方有人说是需要先用

Windows中的输入法是与键盘布局相对应的,所以先要卸载掉键盘布局(UnloadKeyboardLayout())和所有的输入法,再重新加载键盘布局(LoadKeyboardLayout),最后按新的顺序加载输入法

但我不知道具体 怎么操作

TOP

回复 4# 你没有kii


3# 的是 AU3 脚本
  1. DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")
复制代码

TOP

;刷新
  1. DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
复制代码

TOP

回复 3# q410225
直接用BAT吗。我试了不行

TOP

返回列表