Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

How to:  Launch A Console Appplication in Hidden Mode?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ESmith - 22 Jun 2006 14:17 GMT
I want to create a small console application that essentially gets some
information and then launches a Windows Application.  What I want to do is
have the console application launched in hidden mode - I know how to do this
from with a Windows Application by creating a Process and using StartInfo,
but how can I configure a console application to run in hidden mode from
startup?

TIA
r norman - 22 Jun 2006 14:24 GMT
>I want to create a small console application that essentially gets some
>information and then launches a Windows Application.  What I want to do is
>have the console application launched in hidden mode - I know how to do this
>from with a Windows Application by creating a Process and using StartInfo,
>but how can I configure a console application to run in hidden mode from
>startup?

What about starting a hidden Windows application that does nothing
except run the console application?  It is not at all elegant, but you
already know how to do it and it will work.
Noah Stein - 23 Jun 2006 00:26 GMT
Execute it with a System.Diagnostics.Process. You can set the property
CreateNoWindow to false. You can also have it redirect standard output so
that you can send the text written out anywhere you want. Here's some code
from one of my VBA macros:

       Dim p As System.Diagnostics.Process = New System.Diagnostics.Process
       p.StartInfo.FileName = "myeditor"
       p.StartInfo.WorkingDirectory = doc.Path
       p.StartInfo.Arguments = Cmd$ & " " & doc.Name
       p.StartInfo.UseShellExecute = False
       p.StartInfo.RedirectStandardOutput = True
       p.StartInfo.CreateNoWindow = True
       p.Start()
       p.WaitForExit()

Good luck.

-- Noah

>I want to create a small console application that essentially gets some
>information and then launches a Windows Application.  What I want to do is
[quoted text clipped - 4 lines]
>
> TIA
Michael D. Ober - 23 Jun 2006 04:48 GMT
Since you are creating the console application, how about creating a
WinForms application that starts with Sub Main().  In Sub Main, you do your
data gathering and initialization and then issue Form1.ShowDialog.  The Sub
Main() will stop and wait for the form to be closed before continuing.

Mike Ober.

> I want to create a small console application that essentially gets some
> information and then launches a Windows Application.  What I want to do is
[quoted text clipped - 4 lines]
>
> TIA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.