The answer my friend is blowing in GetWnd()...
A totally Windows noob question. I need to retrieve information about the layout and content of any given Windows application. Would it be possible to get
from a running application in Windows?
- the positions of all buttons
- a label or some kind of "name" from each button
- the menu entries
The information has to be somewhere because Windows has to layout the application but how difficult would it be to get it?
Any hints are appreciated.
Thanks for the hint. Would it be a lot work to give me a small snippet on how to retrieve, for example, a list of buttons an application has? Just a few lines to get me started?
I'm planning to integrate a small dll into my Java code. I'm trying to figure out if I can do this by myself or if should hire someone for that.
Speaking of: do you know good places to find Windows developer? I know getacoder etc, but I mean more a developer forum like this one here.
That is a toughie...maybe count in hex??Originally Posted by Ska Software
"And an A, B - A, B, C, D!"
Of course the audience would assume that you're just rambling through the alphabet, but YOU know better..
Naturally, you'd have to be The Hex Pistols
@baegsi: Seriously, google GetWnd (and maybe "sample" or "tutorial") and
it should lead you to what you need to find. I've used it a lot of times, and it IS an easy call. Every control in Windows is a HWND, so once you find one, you can snag all the child controls off of it..
I think even the MSDN has some sample code in the definition of GetWnd itself...(IIRC)
Or even better : zero-zero zero-one, one-zero and one-one!Originally Posted by Ska Software
Google Zürich - Formerly Mystery Studio
Is this to find the positions of your own buttons in your own window or are you trying to peek into other applications and find their buttons?
Of course this kind of thing will only work if the buttons in the Windows were created with the standard Windows GUI tools (user.dll). Most games roll their own GUI elements. If you try to enumerate all the buttons in any game I ever worked on you will find none of them have any. They all have things that look like buttons, but they are not anything Windows would know anything about.
I'm looking for the gui layout of other applications. But I'm only interested in actual buttons, not simulated ones.Originally Posted by James C. Smith
(I have to admit that my project is only slighted related to game development , but I decided to post it anyway because here are so many helpful coders. Sorry, I hope that's okay...)
I think you'll have to sort of hardcode a small hierarchy then to scan through the existing window app to find what you need..
1. Grab the HWND associated with the window text of the application (ie. "Gamespy" or whatever the heck it would be)..look at the EnumWindows method in the MSDN.
2. Within THAT HWND you'd cycle through the other child controls.
Maybe look at EnumChildWindows using the HWND discovered in step 1.
3. GetWindowText MAY not work when working in step 2 to find the button you want...here's what I saw in the MSDN:
Hth...I've never actually done it, so I hope I'm not misleading you here..this just seems like the most logical approach to me..Code:To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.