折腾半天,做了“废品”,因为状态一直获取不到。
模拟鼠标点击输入法切换“中”“英”状态。高手再想办法获取到“中”“英”状态就能用了
这个办法只适合反人类设计的win10输入法。xp、win7没必要这么麻烦
DECLARE INTEGER FindWindow IN user32 STRING,STRING
DECLARE INTEGER FindWindowEx IN user32 INTEGER,INTEGER,STRING,STRING
lnHwnd1=FindWindow("Shell_TrayWnd",0)
lnHwnd2=FindWindowEx(lnHwnd1,0,"TrayNotifyWnd",NULL)
lnHwnd3=FindWindowEx(lnHwnd2,0,"TrayInputIndicatorWClass",NULL)
lnHwnd4=FindWindowEx(lnHwnd3,0,"IMEModeButton",NULL)
#DEFINE WM_MOUSEMOVE 0x0200
#DEFINE WM_NCLBUTTONDOWN 0x00A1
WM_LBUTTONDOWN = 0x0201
WM_LBUTTONUP = 0x0202
MK_LBUTTON = 0x0001
WM_GETTEXT = 0x000D
DECLARE INTEGER PostMessage IN user32 INTEGER,INTEGER,INTEGER,INTEGER
PostMessage (lnHwnd4,WM_LBUTTONDOWN,MK_LBUTTON ,1) && 按下左键
PostMessage (lnHwnd4,WM_LBUTTONUP,MK_LBUTTON ,1) && 放开左键
[此贴子已经被作者于2023-1-11 18:47编辑过]