Home All Groups Group Topic Archive Search About

Create System.Console from a winforms app

Author
9 May 2006 3:26 PM
Michael D. Ober
Is there a way to create a System.Console from code.  I periodically have a
WinForms app that needs to open a console window for progress tracking.

Thanks,
Mike Ober.

Author
9 May 2006 5:10 PM
Dragon
Hello,
Import 2 functions:

~
    Friend Declare Function AllocConsole Lib "kernel32.dll" ( _
    ) As Boolean

    Friend Declare Function FreeConsole Lib "kernel32.dll" ( _
    ) As Boolean
~

Use first, utilize usual System.Console.Write*/Read* methods and call
the second one when you're done.

Roman

Show quoteHide quote
"Michael D. Ober" <ober***@.alum.mit.edu.nospam> ñîîáùèë/ñîîáùèëà â
íîâîñòÿõ ñëåäóþùåå: news:#uRezz3cGHA.4912@TK2MSFTNGP05.phx.gbl...
>
> Is there a way to create a System.Console from code.  I periodically
have a
> WinForms app that needs to open a console window for progress
tracking.
>
> Thanks,
> Mike Ober.
>
>
>
Author
9 May 2006 9:41 PM
Michael D. Ober
OK - sort of a mix of the full console class I wrote in VB 6 and the
system.console class in the framework.

Thanks,
Mike.

Show quoteHide quote
"Dragon" <no@spam.please> wrote in message
news:O4aqBu4cGHA.4892@TK2MSFTNGP02.phx.gbl...
>
> Hello,
> Import 2 functions:
>
> ~
>     Friend Declare Function AllocConsole Lib "kernel32.dll" ( _
>     ) As Boolean
>
>     Friend Declare Function FreeConsole Lib "kernel32.dll" ( _
>     ) As Boolean
> ~
>
> Use first, utilize usual System.Console.Write*/Read* methods and call
> the second one when you're done.
>
> Roman
>
> "Michael D. Ober" <ober***@.alum.mit.edu.nospam> ñîîáùèë/ñîîáùèëà â
> íîâîñòÿõ ñëåäóþùåå: news:#uRezz3cGHA.4912@TK2MSFTNGP05.phx.gbl...
> >
> > Is there a way to create a System.Console from code.  I periodically
> have a
> > WinForms app that needs to open a console window for progress
> tracking.
> >
> > Thanks,
> > Mike Ober.
> >
> >
> >
>
>
>