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

Disable topmost window state #1

Open
AlexMnrs opened this issue Sep 10, 2021 · 0 comments
Open

Disable topmost window state #1

AlexMnrs opened this issue Sep 10, 2021 · 0 comments

Comments

@AlexMnrs
Copy link

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 👍

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