473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

minimizing console window on startup

Hi everyone,

I have a c# console app that when run through an autorun.inf file, launches
a web page from the CD. It works just fine but I would like the console
window minimized on startup. Currently, the console window displays briefly,
the web page loads, and the console window disappears.

The only line of code currently in the console app is...
System.Diagnostics.Process.Start("blahblahblah.htm ")

Any suggestions?

Thanks,
Scott
May 25 '06 #1
5 3443

Scott wrote:
Hi everyone,

I have a c# console app that when run through an autorun.inf file, launches
a web page from the CD. It works just fine but I would like the console
window minimized on startup. Currently, the console window displays briefly,
the web page loads, and the console window disappears.

The only line of code currently in the console app is...
System.Diagnostics.Process.Start("blahblahblah.htm ")

Any suggestions?

Don't know if this will work offhand, but couldn't you just have a GUI
app that doesn't create a form? It just does the Start() then returns.
Thanks,
Scott


HTH
Ian C

May 25 '06 #2
Thanks, Ian.

I tried creating a windows form app (but didn't hide it) to see what would
happen. The form loads, the web page is loaded but after closing the web
page, the winform app remains open. I'm not sure how to handle that.
Otherwise, I'm sure a winform could be hidden.

Scott

"Ian C" wrote:

Scott wrote:
Hi everyone,

I have a c# console app that when run through an autorun.inf file, launches
a web page from the CD. It works just fine but I would like the console
window minimized on startup. Currently, the console window displays briefly,
the web page loads, and the console window disappears.

The only line of code currently in the console app is...
System.Diagnostics.Process.Start("blahblahblah.htm ")

Any suggestions?


Don't know if this will work offhand, but couldn't you just have a GUI
app that doesn't create a form? It just does the Start() then returns.
Thanks,
Scott


HTH
Ian C

May 25 '06 #3
Scott wrote:
Thanks, Ian.

I tried creating a windows form app (but didn't hide it) to see what would
happen. The form loads, the web page is loaded but after closing the web
page, the winform app remains open. I'm not sure how to handle that.
Otherwise, I'm sure a winform could be hidden.

Hello Scott

I don't have access to Visual Studio as I'm working in UNIX land at the
minute (well, don't have access to it anywhere!), but what I meant was
have no form at all.

For instance put this in launch.cs:

using System;
using System.Diagnostics;

namespace Launch
{
class Launch
{
static public void Main(string[] args)
{
Process.Start("test.html");
}
}
}

Then just try compiling it with:

csc /t:winexe launch.cs

I then ran it with a double click, and no console window.

In short, a GUI app doesn't need to go anywhere near a Forms object. I
seem to remember that being a GUI app just means the OS won't create a
console for you...
Scott

Ian C

May 25 '06 #4
got it now! Thanks, Ian, that was a great tip. And now, no more annoying
console window popping up or form to worry about hiding/minimizing.

Scott

"Ian C" wrote:
Scott wrote:
Thanks, Ian.

I tried creating a windows form app (but didn't hide it) to see what would
happen. The form loads, the web page is loaded but after closing the web
page, the winform app remains open. I'm not sure how to handle that.
Otherwise, I'm sure a winform could be hidden.


Hello Scott

I don't have access to Visual Studio as I'm working in UNIX land at the
minute (well, don't have access to it anywhere!), but what I meant was
have no form at all.

For instance put this in launch.cs:

using System;
using System.Diagnostics;

namespace Launch
{
class Launch
{
static public void Main(string[] args)
{
Process.Start("test.html");
}
}
}

Then just try compiling it with:

csc /t:winexe launch.cs

I then ran it with a double click, and no console window.

In short, a GUI app doesn't need to go anywhere near a Forms object. I
seem to remember that being a GUI app just means the OS won't create a
console for you...
Scott

Ian C

May 25 '06 #5

Scott wrote:
got it now! Thanks, Ian, that was a great tip. And now, no more annoying
console window popping up or form to worry about hiding/minimizing.


You're welcome Scott. I only wandered in here by mistake from
comp.lang.c :-)

May 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Chris Maloof | last post by:
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via...
4
by: jabailo | last post by:
This is driving me crazy. I finally got the Remoting sample chat application working almost. When I run the chat client in VS.NET it goes into an endless loop -- that's because I assume that...
2
by: JezB | last post by:
I'm compiling an old C program within Visual Studio to give me the advantages of debugging within this environment. I'm building it as a Console application using C++ as the language. It compiles...
12
by: Jarod_24 | last post by:
I got a project called "Forms" that hold some forms and stuff in my solution. A argument at startup defines wether to use a From or Console. My plan was to create a myConsole class that would...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
3
by: Daniel Clark | last post by:
I have a Windows command line based application that only shuts down cleanly if it sees "CTRL-C" on the console. I need to automate the running of this application, but still allow the user sitting...
0
by: Internet User | last post by:
I happened to notice that it is possible to set VS configuration settings in VB2003 for what is otherwise a Windows application project such that Output Type can be set to Console and a form is set...
13
by: =?Utf-8?B?c29sZXI=?= | last post by:
need to write a simple app with console output and file i/o to be distributed to other machines. Is it possbile in c# without .net overhead, not sure if all machines Xp have .net installed. ...
3
by: qazplm114477 | last post by:
Hi, I'm having a tiny problem. I have just started playing around with visual basic a week ago so im fairly new at this. I created a method that saves changes when you click a button, once the button...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.