VFP的IMESTATUS()适用XP,之后的windows版本可能不适用。
可以试试用WinAPI切换输入法,如:
DECLARE LONG GetKeyboardLayout IN User32 LONG
DECLARE LONG LoadKeyboardLayout IN User32 STRING@, LONG
DECLARE LONG ActivateKeyboardLayout IN User32 LONG,LONG
hLayout = GetKeyboardLayout(0)
?"切换为En输入法"
LoadKeyboardLayout("0x0409", 1) && KLF_ACTIVATE
?"按一键恢复原输入法"
INKEY(0)
ActivateKeyboardLayout(hLayout, 0)
https://bbs.bccn.net/viewthread.php?tid=485814&highlight=%CA%E4%C8%EB%B7%A8
VFP的IMESTATUS()适用XP,之后的windows版本可能不适用。
可以试试用WinAPI切换输入法,如:
DECLARE LONG GetKeyboardLayout IN User32 LONG
DECLARE LONG LoadKeyboardLayout IN User32 STRING@, LONG
DECLARE LONG ActivateKeyboardLayout IN User32 LONG,LONG
hLayout = GetKeyboardLayout(0)
?"切换为En输入法"
LoadKeyboardLayout("0x0409", 1) && KLF_ACTIVATE
?"按一键恢复原输入法"
INKEY(0)
ActivateKeyboardLayout(hLayout, 0)
上面是2018年的帖子,吹版提供的方法,试过了,可以达到目的
有一点不知能否实现,用了上面的方法,第一次右下角键盘位置显示为 ENG ,再点就没有了,等于输入法当前状态看不到了,能否只切换“中”“英”状态?