Skip to content

Disable topmost window stateΒ #1

@AlexMnrs

Description

@AlexMnrs

Hello,

I know it's been a long time since the release of this tool but I've got a question.

I'd want to make the tool to disable the topmost state when using argument -r or --reset.

def enumHandler(hwnd, lParam):
    if win32gui.IsWindowVisible(hwnd):
        if sys.argv[1].lower() in win32gui.GetWindowText(hwnd).lower():
            win32gui.SetWindowPos(hwnd, -1, 0, 0, 0, 0, 0x0001)
            return True
        elif sys.argv[1].lower() in win32gui.GetWindowText(hwnd).lower() 
        and sys.argv[2] in ["-r", "-reset", "--reset", "--r"]:
            win32gui.SetWindowPos(hwnd, 1, 0, 0, 0, 0, 0x0001)
            return True

I just added that elif to your code so if there is an -r argument the topmost state should be disabled and window should be no longer placed above all non-topmost windows. As you can see I've set the hWndInsertAfter parameter to HWND_BOTTOM (1), but it doesn't work.

Any suggestions? Thanks a lot πŸ‘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions