Tech Support > Microsoft Windows > Development Resources > Fetching Message Box text from an external app?
Fetching Message Box text from an external app?
Posted by David Jacobitz on February 10th, 2004


Both GetWindowText and using a SendMessageTimeout with WM_GETTEXT only
return the window caption (title bar). Is there *any* way to get the
text of a message box thrown by another app short of getting the DC
and OCR'ing the damn thing?

-Dave

Posted by Raymond Chen on February 10th, 2004


Call GetWindowText on the static control inside the messagebox.

On 10 Feb 2004 09:00:07 -0800, pastymage@yahoo.com (David
Jacobitz) wrote:

Posted by David Jacobitz on February 14th, 2004


Unfortunately, stepping through the child windows, I can't find a
reference to anything in the messagebox except for the "yes", "no"
buttons. Is the background of the message box itself a "hidden"
window?

-Dave

Raymond Chen <http://guest@weblogs.asp.net/oldnewthing/> wrote in message news:<k24i2099rgme07o2fllmpg8g4vvn88iu40@4ax.com>. ..

Posted by Raymond Chen on February 14th, 2004


There should be a static control in there. I see it with Spy++.

On 14 Feb 2004 11:08:31 -0800, pastymage@yahoo.com (David
Jacobitz) wrote:

Posted by David Jacobitz on February 17th, 2004


So do I when I look at message boxes from other apps. This one, not
so much. Possibly they've made a custom message box form for some
bizarre reason?

Would I have to assume that if I'm *not* seeing a static control,
the text has been put directly into the graphics DC of the form, and
I'm screwed?

-Dave

Raymond Chen <http://guest@weblogs.asp.net/oldnewthing/> wrote in message news:<mldt20lmunh481r1st9r0oh1hnh9j8q98u@4ax.com>. ..

Posted by Raymond Chen on February 18th, 2004


Sounds like this app is using some custom dialog then. Maybe it
will respond to AcessibleObjectFromWindow?

On 17 Feb 2004 09:06:02 -0800, pastymage@yahoo.com (David
Jacobitz) wrote:

Posted by David Jacobitz on February 23rd, 2004


Good thought, but no dice.
I think I have a workaround, though. Since the number of messages
that can be thrown is finite (there's no item-specific data in them),
I can just capture the graphics of the box itself, and unless I'm
terribly unlucky, they'll all have unique values I can exploit without
actually OCRing the stuff. We'll see how that works in practice.

-Dave

Raymond Chen <http://guest@weblogs.asp.net/oldnewthing/> wrote in message news:<as0630hc3oitbmvr0vpvs552i4q8npluif@4ax.com>. ..

Posted by Alf P. Steinbach on February 23rd, 2004


Why can't you morons stop top-posting?

* pastymage@yahoo.com (David Jacobitz) schriebt:


Similar Posts