Some post previously seems relevant to this. Now I want to detect whether a program is using input method, such as Chinese. If so, change it to English.
This can avoid many troubles when you're using MS "send" command.
Script sample:
Setfocus>UltraEdit*
GetActiveWindow>window_title,X,Y
GetWindowHandle>window_title,handle
LibFunc>user32,GetWindowThreadProcessId,TID,handle,
LibFunc>user32,GetKeyboardLayout,KBhandle,TID
LibFunc>imm32,ImmIsIME,InputMethod,KBhandle
Messagemodal>InputMethod
If you're using InputMethod other than English, the InputMethod shall be 1.
Get a program's Input Method
Moderators: JRL, Dorian (MJT support)
Microsoft Word
However!! The above script works well for simple word processing software such as Ultraedit, notepad, etc. It won't work for Microsoft Word!
This headache me very, very much.
Presently I appeal to Microsoft Word macro to change the input method to English. Here's the macro and you can use MS to automating it:
Option Explicit
Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal hkl As Long, ByVal flags As Long) As Long
Public hCurKBDLayout As Long
Sub autoexec()
hCurKBDLayout = 67699721 'English; Chinese1 -536606716; Chinese2 -535951356
ActivateKeyboardLayout hCurKBDLayout, 0
End Sub
Can any experts show some better way??? (and, can the macro above run in a temporary file other than in word macro?)
This headache me very, very much.
Presently I appeal to Microsoft Word macro to change the input method to English. Here's the macro and you can use MS to automating it:
Option Explicit
Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal hkl As Long, ByVal flags As Long) As Long
Public hCurKBDLayout As Long
Sub autoexec()
hCurKBDLayout = 67699721 'English; Chinese1 -536606716; Chinese2 -535951356
ActivateKeyboardLayout hCurKBDLayout, 0
End Sub
Can any experts show some better way??? (and, can the macro above run in a temporary file other than in word macro?)