I’m trying to find a way to draw something on the screen that will show on top of anything else that is running (even full screen applications), but will not steal focus, or act like a normal application or window. It should be purely visual and not interfere in any other way.
Python is preferable.
What I’m aiming for is to be able to have my python script display a notification on the screen, possibly just some text (transparent background), and for it to show in front of whatever else you are doing at the time.
I’ve tried wxpython, but either the window steals focus, or I use the trick to not steal focus and it doesn’t appear in front of my full screen applications. It feels like wxpython isn’t really made for what I want to do, seeing as it’s not supposed to be a GUI, it just supposed to be a notification that appears temporarily and takes no user input.
In general, you cannot write an application which guarantees to stay on top of other applications which want to stay on top of other applications.
Since a full-screen application is window which is topmost, there is no way for the OS to know that your topmost window needs to be topmoster than the other topmost window.
Ideally, you should find some way of cooperating with the other application.
However here are some tricks you can try, which may work for some situations:
SetWindowPoswithSWP_NOACTIVATEand
HWND_TOPMOSTto move it to the front without activating.SPI_SETFOREGROUNDLOCKTIMEOUTinSystemParametersInfoto a small value.Please note that these tricks will not help if the other window is doing the same thing.
Useful documentaion here: