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

Prompt or Alert windows Always-On-Top? #877

Open
Fxztam opened this issue Aug 21, 2024 · 1 comment
Open

Prompt or Alert windows Always-On-Top? #877

Fxztam opened this issue Aug 21, 2024 · 1 comment

Comments

@Fxztam
Copy link

Fxztam commented Aug 21, 2024

I am working with PyAutoGUI and it's great.

In my workflow, I need some steps with Alert queries and Prompt inputs,

but these are hidden from the active GUI window.

Is there a chance, these Alert, Prompt etc. windows to set Always-On-Top?

Thanks, Fried

@pLazyN
Copy link

pLazyN commented Sep 30, 2024

I switched to a native Windows message box for that using ctypes. There you can specify MB_SYSTEMMODAL to keep it on top.

import ctypes

MessageBox = ctypes.windll.user32.MessageBoxW

ID = MessageBox(None, u'your text', '', 0X40 | 0x1000)

also see: https://stackoverflow.com/questions/50086178/python-how-to-keep-messageboxw-on-top-of-all-other-windows

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

2 participants