From: Jonathan de Boyne Pollard on
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote
cite="mid:a6e192d7-1fdf-4fc5-83d3-70262aba98ba(a)g4g2000yqa.googlegroups.com"
type="cite">
<p wrap="">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. <br>
</p>
</blockquote>
<p>Process handle, not window handle.  If you spawned the process in
the first place, then you controlled what console it inherited via the
process creation flags.<br>
</p>
<p>But since this isn't your real problem ...</p>
<blockquote
cite="mid:f348487c-b790-483f-9d54-6e970a6793a5(a)n34g2000yqb.googlegroups.com"
type="cite">
<p wrap="">What I'm actually doing is running a Telnet session,
logging it in, running a couple of commands, then leaving it running.<br>
</p>
</blockquote>
<p>... you should <a
href="http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/put-down-the-chocolate-covered-banana.html">put
down the chocolate-covered banana, step away from the European currency
systems</a>, and solve your real problem.  As M. Steinbach mentioned,
you can tell <code>telnet</code> to log-in as a given user via
command-line options.</p>
</body>
</html>
From: Matti Vuori on
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups(a)NTLWorld.COM>
wrote in
news:IU.D20100331.T171811.P2159.Q0(a)J.de.Boyne.Pollard.localhost:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
> <title></title>

Please, don't post HTML to newsgroups.
From: Jonathan de Boyne Pollard on
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<p>And at this point in the thread we find a problem statement of <em>another</em>
underlying different real problem:</p>
<blockquote
cite="mid:40d9ddc2-8f9a-4abe-919f-d9914ffba236(a)z11g2000yqz.googlegroups.com"
type="cite">
<p>Now, I am trying to make this into a generic Command Prompt
automation suite, so I can quickly throw together scripts that send
commands to a Command Prompt and interrogate the screen, not limited to
STDIO either, I want this to work with screen-drawing applicatons,
eventually I want to write a Nethack bot with it.</p>
</blockquote>
<p>Then you need to read <a
href="http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/capture-console-win32.html">another
Frequently Given Answer about that</a>.</p>
</body>
</html>
From: Jonathan de Boyne Pollard on
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:Xns9D4CE3334E264xmvuorikolumbusfi(a)195.197.54.114"
type="cite">
<p>Please, don't post HTML to newsgroups.</p>
</blockquote>
<p>Please learn about Usenet, and about the <em>actual</em>
distinction, between text and <em>binaries</em>, that it has.&nbsp; Then
learn what the 'T' in "HTML" stands for.<br>
</p>
</body>
</html>
From: Phil Hibbs on
Jonathan de Boyne Pollard wrote:
> And at this point in the thread we find a problem statement of another
> underlying different real problem:

How is that different from my original post? I want to get a
hConsoleOutput handle, so that I can read the contents directly
instead of stuffing the keys for a Select All command into the
prompt's system menu.

> Then you need to readanother Frequently Given Answer about that.

OK, that's 100% on topic for what I want to do, I do want to
continuously poll the output buffer and I am aware that I might miss
something if it scrolls out of the buffer before I poll it. There
isn't really an answer in there, though, just a general warning that
the approach is problematic. I know that, but it's the only approach
that can achieve what I want, so I'll have to either live with the
problems or stick with the Alt-Space key-stuffing approach which has
its own problems.

Phil Hibbs.