From: Johan Lindstrom <johanl@ba...> - 2002-06-05 22:29:39
At 13:14 2002-06-04 -0700, Khan, Moin wrote:
>I am trying to look for the title of window(eg. Dr. Watson Error on
>Desktop) so i can log that error?
Not sure what you're after here...
If you want the title (the text in the Titlebar of the window) of the
topmost window, here's how to do it:
my $title = Win32::GUI::Text(Win32::GUI::GetForegroundWindow()) || "";
If the DrWatson window isn't put on top, then you'll have to find the
window handler (hwind) some other way. I think that you can enumerate the
application windows using Win32::ActAcc and/or Win32::GuiTest.
If what you really want is the text displayed _in_ the window, then you can
find the hwind of the DrWatson top window, and then using one of the above
modules find the control that contains the text.
If you have Visual Studion installed, look at the program Spy++ something
that can be used to analyze windows on-screen.
-------- ------ ---- --- -- -- -- - - - - -
Johan Lindström Sourcerer @ Boss Casinos johanl@...
Latest bookmark: "Phil's Field Guide to Trolls"
Get latest updates about Open Source Projects, Conferences and News.