is it possible to create an additional console window from a WinApp compiled
with /winexe ?
thanx in advance
juergen seitz
If you want to open a console application from Win32 application. Take a
look at System.Diagnostics.Process class.
Hope this helps.
Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
|From: "Jürgen Seitz" <jot....@t-online.de>
|Subject: console window out of a c# winapp
|Date: Wed, 29 May 2002 20:42:51 +0200
Jürgen Seitz
"Max[MS]" <m...@online.microsoft.com> schrieb im Newsbeitrag
news:xMMbgA9BCHA.2060@cpmsftngxa08...
"Jürgen Seitz" <jot....@t-online.de> wrote in message
news:#y3NWD0BCHA.1588@tkmsftngp02...
In Windows, there're many APIs related console application such as
AllocConsole,AttachConsole. You can search console function in MSDN.
In .NET, you have to use PInvoke to call these APIs to create a console
window. There is a sample in MSDN,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/con
char_7g6r.asp for your reference.
Hope this helps.
Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
|From: "Jürgen Seitz" <jot....@t-online.de>
|References: <#y3NWD0BCHA.1588@tkmsftngp02> <xMMbgA9BCHA.2060@cpmsftngxa08>
|Subject: Re: console window out of a c# winapp
"NETMaster" <spam.ne...@swissonline.ch> wrote in message
news:eOh9giACCHA.2672@tkmsftngp05...
> To show a console from a GUI app is easy (PInvoke: AllocConsole)
> but for output with Console.Write there is some more interop needed:
>
> ok = AllocConsole();
> conOut = CreateFile( "CONOUT$", 0x40000000, 2, IntPtr.Zero, 3, 0,
IntPtr.Zero );
> ok = SetStdHandle( -11, conOut );
> Console.WriteLine( "Console ready!" );
>
> check sample attached!
> (Note, it does NOT restore the previous output!)
>
> MSDN:
> read 'remarks' for SetStdHandle
> http://msdn.microsoft.com/library/en-us/dllproc/conchar_7y79.asp
>
> KB Q90088 INFO: CreateFile() Using CONOUT$ or CONIN$
>
>
>
> --
> NETMaster (Thomas Scheidegger)
> http://www.cetus-links.org/oo_csharp.html
>
>
>
>
>
>
> "nautonnier" <OnTheLambFromAllThatSpam> wrote in message
news:uRw8vR$BCHA.2004@tkmsftngp02...
> > I'm amazed at how many times I've seen this question posed and yet
*never*
> > answered. I would like to know if this possible myself.
> > "Jürgen Seitz" <jot....@t-online.de> wrote in message
> > news:#y3NWD0BCHA.1588@tkmsftngp02...
--
William Stacey, MCSE
Microsoft MVP Windows 2000/NT Server
"NETMaster" <spam.ne...@swissonline.ch> wrote in message
news:eOh9giACCHA.2672@tkmsftngp05...
> To show a console from a GUI app is easy (PInvoke: AllocConsole)
> but for output with Console.Write there is some more interop needed:
>
> ok = AllocConsole();
> conOut = CreateFile( "CONOUT$", 0x40000000, 2, IntPtr.Zero, 3, 0,
IntPtr.Zero );
> ok = SetStdHandle( -11, conOut );
> Console.WriteLine( "Console ready!" );
>
> check sample attached!
> (Note, it does NOT restore the previous output!)
>
> MSDN:
> read 'remarks' for SetStdHandle
> http://msdn.microsoft.com/library/en-us/dllproc/conchar_7y79.asp
>
> KB Q90088 INFO: CreateFile() Using CONOUT$ or CONIN$
>
>
>
> --
> NETMaster (Thomas Scheidegger)
> http://www.cetus-links.org/oo_csharp.html
>
>
>
>
>
>
> "nautonnier" <OnTheLambFromAllThatSpam> wrote in message
news:uRw8vR$BCHA.2004@tkmsftngp02...
> > I'm amazed at how many times I've seen this question posed and yet
*never*
> > answered. I would like to know if this possible myself.
> > "Jürgen Seitz" <jot....@t-online.de> wrote in message
> > news:#y3NWD0BCHA.1588@tkmsftngp02...
Jason