We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isEnglishMode(){ hWnd := winGetID("A") result := SendMessage( 0x283, ; Message : WM_IME_CONTROL 0x001, ; wParam : IMC_GETCONVERSIONMODE 0, ; lParam : (NoArgs) , ; Control : (Window) ; Retrieves the default window handle to the IME class. "ahk_id " DllCall("imm32\ImmGetDefaultIMEWnd", "Uint", hWnd, "Uint") ) ; 返回值是0表示是英文模式,其他值表明是中文模式 return result == 0 }
这段代码可以检测到普通的窗口,但是没有办法检测到 UMP 窗口,比如 Microsoft TODO。
The text was updated successfully, but these errors were encountered:
试着在前面加上下面这一段代码
DetectHiddenWindows True
如果加上还没有用,那么我也暂时解决不了🤣,我不怎么熟悉UWP
Sorry, something went wrong.
好的,谢谢,我的已经加上了,还是不行。
这里的问题出在很多 UWP 应用使用了 ApplicationFrameHost,如果用 Window Spy 会发现不同的应用检测到的都是这个,于是代码里的 WinGetID("A") 就失效了。解决办法如下:
WinGetID("A")
首先增加函数:
WinGetActiveID() { name := WinGetProcessName("A") if (name = "ApplicationFrameHost.exe") { return ControlGetHwnd("Windows.UI.Core.CoreWindow1", "A") } else { return WinGetID("A") } }
然后把代码里的 WinGetID("A") 替换成上面定义的 WinGetActiveID() 就可以了。
WinGetActiveID()
希望有帮助 :)
参考资料
No branches or pull requests
这段代码可以检测到普通的窗口,但是没有办法检测到 UMP 窗口,比如 Microsoft TODO。
The text was updated successfully, but these errors were encountered: