BobFishel has asked for the wisdom of the Perl Monks concerning the following question:

Wise Monks, I require your assistance!

Using Win32::GuiTest I've been able to use FindWindowLike() to get a handle to a foreign (non-owned) window, but I still can't find a way to reference the individual widgets in the window. For example, I'd like to read and set the text of a textfield and scrape text from a listbox. Ideally I'm looking for a loop that would print out each widget and handle to it and a way to call methods (getline for a text field for example) on it.

Any help is appreciated!
  • Comment on How can I retreive a list of widgets in a non-owned window (Win32::GUI / Win32::GuiTest)

Replies are listed 'Best First'.
Re: How can I retreive a list of widgets in a non-owned window (Win32::GUI / Win32::GuiTest)
by Corion (Patriarch) on Jan 18, 2009 at 15:35 UTC

    As I already pointed out to you, Win32::GuiTest comes with the spy--.pl program, which lists the controls in a window. You can't call methods on these, as they are not part of your program. You can use Win32::GUI to "call methods" on the foreign controls given their handle, or you can just use the tools that Win32::GuiTest gives you.