[Python] How can I close a stuck window using AHK or Python?

Discussão em 'Python' iniciado por Stack, Março 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Chromium based software that is really buggy, for some reason some windows of that process become unkillable, I can move them around but I cannot close them.

    I've tried to use winclose and winkill in AHK but it doesn't work (while the script correctly works on other windows). I've also tried the script below but it closes all the windows of the process. I don't know any language besides AHK and Python and maybe I need to use a low-level language

    i::
    MouseGetPos,,, id
    MsgBox, The window ID under the mouse is: %id%
    WinGet, pid, PID, ahk_id %id%
    hProcess := DllCall("OpenProcess", "UInt", 1, "Int", 0, "UInt", pid, "Ptr")
    DllCall("ntdll\NtTerminateProcess", "ptr", hProcess, "UInt", 0)
    DllCall("CloseHandle", "ptr", hProcess)
    return

    Continue reading...

Compartilhe esta Página