xterm is a console program?

Harold L Hunt II huntharo@msu.edu
Fri May 16 19:09:00 GMT 2003


Karl,

You have to read our description more closely.

Yes, we all admit that you can *create a new console* and output 
messages to it.  However, no one cares about that.

There are two distinct cases to what we are talking about, and this is 
the last time that I am going to describe it to someone.

Case one
========
1) User double-clicks an X app in Windows Explorer.

2) X app opens without causing a command-prompt window to be created.

3) Currently, double-clicking an X app will cause a new command-prompt 
window to be opened that will remain open for the duration that the X 
app is open.  This is undesired behavior.

4) Double-clicked X apps should not open a command-prompt window at all.


Case two
========
1) User opens a command prompt window.

2) User launches an X app from the command prompt window.

3) *CRUCIAL PART*  The X app, being very smart, notices that it was 
launched from a console window and attaches its text output to that very 
same console window.  NO NEW CONSOLE IS CREATED.

4) Any text error messages (via printf, etc.) from the X app go to the 
command prompt window that the X app was launched from.


To reiterate what I said before, the problem here is that the Win32 API 
does not provide a way to determine that you were launched from a 
conosole, find that console's id, and attach to that console, all while 
still not causing a seperate console to popup if you double-click the X 
app in Windows Explorer.  That is the dillema we face.  As Chris 
mentioned, there may have been new API calls added to Windows XP that 
allow this.  However, this does not help us because we claim to support 
Windows 95/98/Me and Windows NT 4.0/2000/XP.  We would need a solution 
that worked on all platforms and there are many articles on the net that 
indicate that such a solution does not exist.


I hope that clears things up.

Harold

Karl Waclawek wrote:

> Harold, sorry for reading this so late:
> 
> 
>>I remember reading somewhere (didn't look for it again) that there is
>>no way for a Windows app to attach to the console that it was launched from. 
> 
> 
> I am not sure what you mean with attach, but I can create a Windows GUI app that
> also has a console (or uses the console from which it was started) and can
> perform read and write functions on that console, while at the same time
> running a GUI.
> 
> This is extremely simple using Delphi and I don't even need to access
> the Windows API to do that.
> 
> Karl



More information about the Cygwin-xfree mailing list