I am currently doing research on how to properly implement a listener for a windows coordinates. I'm working on an external overlay app that just displays statistics and I want the app to be on top of X application.
One way of doing this is get the HWND of an application using the ctypes library to get a windows coords and position and make a threaded function that has an infinite while loop that relocates my app at the prefered coordinates.
I was wondering if there would be better ways of doing this without looping since looping has a somewhat of a small delay which is still noticeable.
I was looking through the windows API for user32 and noticed that you can set parent apps to your own app and thought maybe there is a way to hook the parents window location to that of the child window(child window being my app and the parent window being the selected app) but I couldnt find anything regarding this online.
Note: I do not want to mess with dll injection or opengl/directx GPU UI drawing since some recommend that but thats not the direction I want to go