Hi Experts:

I have a small console application which tries to read out the content of
the "Address" edit field in an IE browser window.

I can get the window handle of the "Address" edit control but the
GetWindowText returns empty string and GetLasterror returns 203; under error
Lookup, the error means "The system could not find the environment option
that was entered". No idea what it means.

The window handle of the "Address" edit should be correct since it is the
same as the one shown by the Spy++ program. I can also get the control's
class name correctly.

The Spy program shows the content of the Address edit correctly. I just
wonder what I'm missing here?

Thanks In Advance!
Polaris

Re: Why GetWindowText returns empty string by Igor

Igor
Fri Jul 21 15:25:35 CDT 2006

Polaris <etpolaris@hotmail.com> wrote:
> I have a small console application which tries to read out the
> content of the "Address" edit field in an IE browser window.

From GetWindowText docs: "GetWindowText cannot retrieve the text of a
control in another application".

Send WM_GETTEXT message to the control instead.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: Why GetWindowText returns empty string by Polaris

Polaris
Fri Jul 21 17:20:49 CDT 2006

Thanks! It works.

Polaris

"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:e88qTPQrGHA.3564@TK2MSFTNGP03.phx.gbl...
> Polaris <etpolaris@hotmail.com> wrote:
>> I have a small console application which tries to read out the
>> content of the "Address" edit field in an IE browser window.
>
> From GetWindowText docs: "GetWindowText cannot retrieve the text of a
> control in another application".
>
> Send WM_GETTEXT message to the control instead.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>