Skip to content
New issue

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

系统笔记本无法正确识别状态 #4

Open
ynuance opened this issue Oct 8, 2023 · 0 comments
Open

系统笔记本无法正确识别状态 #4

ynuance opened this issue Oct 8, 2023 · 0 comments

Comments

@ynuance
Copy link

ynuance commented Oct 8, 2023

一直停留在中,切换无反应,改成以下代码后正常,猜测是autohotkey的hwnd识别有问题?
部分代码来自

  • ; 可以用于判断微软拼音是否是英文模式
    isEnglishMode(WinTitle:="A"){
    hwnd := WinExist(WinTitle)
    if (WinActive(WinTitle)) {
    ptrSize := !A_PtrSize ? 4 : A_PtrSize
    cbSize := 4+4+(PtrSize6)+16 ; DWORD2+HWND*6+RECT
    stGTI := Buffer(cbSize,0)
    NumPut("UInt", cbSize, stGTI.Ptr,0) ; DWORD cbSize;
    hwnd := DllCall("GetGUIThreadInfo", "Uint",0, "Uint",stGTI.Ptr)
    ? NumGet(stGTI.Ptr,8+PtrSize,"Uint") : hwnd
    }
    result := DllCall("SendMessage"
    , "Uint", DllCall("imm32\ImmGetDefaultIMEWnd", "Uint",hwnd)
    , "Uint", 0x0283 ;Message : WM_IME_CONTROL
    , "Int", 0x001 ;wParam : IMC_GETCONVERSIONMODE
    , "Int", 0) ;lParam : 0
    return result == 0
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant