首页 > 开发 > 综合 > 正文

如何在PB中切换中英文输入法数

2024-07-21 02:10:23
字体:
来源:转载
供稿:网友

如何在pb中切换中英文输入法数

函数声明:

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




发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表