📄 datawindow自动切换中英文输入法.txt
字号:
datawindow自动切换中英文输入法
//4个apihansu
function boolean ImmSimulateHotKey (ULong hWnd, ULong dwHotKeyID) library "IMM32.dll"
function boolean ImmIsIME(uLong hklKeyboardLayout) library "IMM32.DLL"
//取得当前键盘布局
function ulong GetKeyboardLayout(ulong dwLayout) LIBRARY "user32.dll"
//激活当前键盘布局
FUNCTION ulong ActivateKeyboardLayout(ulong HKL,ulong flags) LIBRARY "user32.dll"
//2个全局变量
//自动切换输入法
ulong hklCurrent //键盘布局
ulong hwnd //窗口句柄
//////////////////////////////////////
//2个全局函数
//参数 ulong hwnd
//切换到英文输入法:
hklCurrent = GetKeyboardLayout(0)//系统默认输入法
if ImmIsIME(hklCurrent) then
ImmSimulateHotKey(hwnd,112)
ActivateKeyboardLayout(0,1)
end if
//参数 ulong hwnd
//切换到中文输入法:
hklCurrent = GetKeyboardLayout(0) //系统默认输入法
if not ImmIsIME(hklCurrent) then
ImmSimulateHotKey(hwnd,112)
ActivateKeyboardLayout(0,1)
end if
//引用datawindow itemfocuschanged event
hwnd = Handle(parent)
choose case dwo.name
case 'f_jh','c_xsrq'
gf_english(hwnd)
case else
gf_chinese(hwnd)
end choose
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -