How can I get the window position/size from a different program's window?
What I want to do is create a semi-transparent overlay over another program's window that displays stats on what is happening on the window in the background. I know how to do everything that I want to do with this program except find the properties of window such as position, size, and title so 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 the transparent HUD that appears over each table. I basically need to do the same type of thing. I have searched many things and have not had any 开发者_StackOverflow中文版luck so far. I will be using Qt4 or PyQt4 most likely for the GUI so if that toolkit provides the right functions to do this and I just haven't been able to find them yet, that would be great. If I need to use another toolkit too, that doesn't matter. If I need to use something other than the Qt tool kit I would still like to know. However it can be done I would like to know.
In Windows you have to use the Windows API. GetWindowRect can do it. http://msdn.microsoft.com/en-us/library/ms633519%28v=vs.85%29.aspx
But first you have to get the another Window hwnd, with something like FindWindow
精彩评论