gaochao1011:
感谢。我用的是老版本的AHK,这是改写后的:
```
is_chinese_mode() {
WinGet, hWnd, ID, A
origin_detect_hidden_window := A_DetectHiddenWindows
DetectHiddenWindows, On
; 获取当前输入法窗口句柄
IMEWnd := DllCall("imm32\ImmGetDefaultIMEWnd", "UInt", hWnd, "UInt")
; 使用 DllCall 调用 SendMessage
result := DllCall("SendMessage", "UInt", IMEWnd, "UInt", 0x283, "UInt", 0x001, "UInt", 0)
DetectHiddenWindows, %origin_detect_hidden_window%
; 微软拼音(英-中,新/旧,新旧/新旧)0/1024-1/1025
return (result == 1 or result == 1025)
}
$/::
{
if (is_chinese_mode()) {
SendInput, \
} else {
SendInput, /
}
}
```