Re: Execute a Window Application in Command Line

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Stoitcho Goutsev \(100\) [C# MVP] (100_at_100.com)
Date: 06/10/04


Date: Thu, 10 Jun 2004 10:43:54 -0400

Hi Ram if you want to have always that console window runing the easiest way
is to start a WindowsForms application and then go to the project settings
and change the 'Output Type' to 'Console Application'. This way you'll have
windows application the will have console window attached as soon as you
start the application. The other way is to create a console application (as
Marc suggested and add reference to System.Windows.Forms and may one or two
assemblies more) and then in the main method only you have to do is to
create a form and call Application.Run(form). Where 'form' is reference to
the form you just created (the main form of the application). You can also
move the entry point (main method) in the form class and get rid of the
class the wizard created for you

-- 
HTH
Stoitcho Goutsev (100) [C# MVP]
"Ram" <ninja@bezeqint.net> wrote in message
news:OqgOJnuTEHA.2908@TK2MSFTNGP10.phx.gbl...
> Hey,
> After I create the Console App, how can I open a windows Form?
> Thanks ahead
>
> -- Ram
> "Marc Scheuner [MVP ADSI]" <m.scheuner@inova.SPAMBEGONE.ch> wrote in
message
> news:a24gc0tpv20gv7bhm1bb6gb8q0cnp6vk8n@4ax.com...
> > >Unfortunately AFIAK .NET doesn't have managed support for creating
> consoles.
> >
> > ?!?!?!?!?? Have you checked out the "File > New > Project > Visual C#
> > Projects > Console Application" ??
> >
> > Yes, there are some drawbacks in terms of mostly keyboard support
> > (waiting and reading just a single keypress and such), but you can
> > most definitely write fully functional console apps in C# / .NET.
> >
> > Marc
> > ================================================================
> > Marc Scheuner                        May The Source Be With You!
> > Bern, Switzerland                         m.scheuner(at)inova.ch
>
>


Relevant Pages

  • Re: working set and console applications
    ... I created a windows application and then I created a child console process ... that I started from the parent process using CreateProcess. ... I minimize the child console window it also causes the working set of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Console applications window size
    ... AllocConsole() or AttachConsole. ... You already have a console, ... SMALL_RECT srWindowRect; // hold the new window size ... >exe from a cmd prompt, the same cmd prompt gets bigger properly. ...
    (microsoft.public.vc.language)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ...     ByVal hWnd As IntPtr, ...     End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Prevent Domain Users From Browsing Around in Active Directory?
    ... View, Customize, uncheck everything except the top one that says Console ... But they will have the rt-click feature. ... Rt-click on that OU, new window from here. ...
    (microsoft.public.windows.server.active_directory)
  • Re: vb6 run from and output to command window
    ... VB doesn't really create true console applications (because the linker ... allocate the console window, and read/write from/to it. ... Private Declare Function AllocConsole Lib "kernel32" As Long ... Dim lResult As Long ...
    (microsoft.public.vb.general.discussion)