From: Phil Hibbs on
Is there any way of getting a handle to the console of a Command
Prompt application? I can get the process ID, because my Windows
program ran the process in the first place, and I have the window
handle. I want to read its buffer contents directly, rather than
stuffing Alt-Space,e,s,Enter into the keyboard buffer and then reading
the clipboard.

Phil Hibbs.
From: Ulrich Eckhardt on
Phil Hibbs wrote:
> I want to read its [another program's console] buffer contents
> directly, rather than stuffing Alt-Space,e,s,Enter into the
> keyboard buffer and then reading the clipboard.

For the record, this doesn't work reliably. Here, the "e" opens
the "E_igenschaften" (German for properties), not "E_dit".

Uli

--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

From: Phil Hibbs on
Ulrich Eckhardt wrote:
> For the record, this doesn't work reliably. Here, the "e" opens
> the "E_igenschaften" (German for properties), not "E_dit".

Good point - I should use the cursor keys then, "{up 3}{right}{down 3}
{Enter}". Although I've seen things that mess with the menu in other
ways. Good reasons to move away from this method and grab the content
through an API, if it's possible.

Phil Hibbs.

From: Alf P. Steinbach on
* Phil Hibbs:
> Is there any way of getting a handle to the console of a Command
> Prompt application? I can get the process ID, because my Windows
> program ran the process in the first place, and I have the window
> handle. I want to read its buffer contents directly, rather than
> stuffing Alt-Space,e,s,Enter into the keyboard buffer and then reading
> the clipboard.

What's wrong with piping?


Cheers,

- Alf
From: Phil Hibbs on
Alf P. Steinbach wrote:
> What's wrong with piping?

That only works with simple programs that just use STDOUT, anything
that draws on the screen would not work. Also I want to leave the
Command Prompt running at the end so that the user can interact with
it. What I'm actually doing is running a Telnet session, logging it
in, running a couple of commands, then leaving it running.

Phil Hibbs.