How can I get the position / size of a window from another program window?

What I want to do is create a translucent overlay over another program window that displays statistics about what is happening in the window in the background. I know how to do everything that I want to do with this program, except to find window properties such as position, size and name so that I can position my transparent windows in front of the right window. For example, if you don’t know what I mean, if you play online poker and use Poker Tracker. They have a transparent HUD that appears above each table. I basically need to do the same. I was looking for a lot of things and still no luck. I will use Qt4 or PyQt4, most likely for the GUI, so if this toolkit provides the correct functions for this and I just could not find them, that would be great. If I need to use another toolkit, it does not matter. If I need to use something other than the Qt toolkit, I would like to know anyway. However, this can be done, I would like to know.

+4
source share
1 answer

On Windows, you must use the Windows API. GetWindowRect can do this. http://msdn.microsoft.com/en-us/library/ms633519%28v=vs.85%29.aspx

But first you should get another Window hwnd with something like FindWindow

+3
source

Source: https://habr.com/ru/post/1336523/


All Articles