473,785 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to prevent the console window popping up.

Ram
I have a console application that brings up a dialog if invoked with no
command line parameters. If I double click on my application a console window
is briefly displayed before the dialog appears (I have this code in my app:

if (args.length ==0) FreeConsole() which causes the console to be closed)

Is there a way to prevent this console window from appearing in the first
place.
Jul 21 '05 #1
2 3081
It's a console app, so of course it going to open a console if you double
click it from windows explorer. Open a DOS Prompt window
(Start->Run->cmd.exe), then run your console app, and no console window
opens.
"Ram" <Ra*@discussion s.microsoft.com > wrote in message
news:78******** *************** ***********@mic rosoft.com...
I have a console application that brings up a dialog if invoked with no
command line parameters. If I double click on my application a console
window
is briefly displayed before the dialog appears (I have this code in my
app:

if (args.length ==0) FreeConsole() which causes the console to be closed)

Is there a way to prevent this console window from appearing in the first
place.

Jul 21 '05 #2
have you tried compiling it as a winexe in the target /t parm of the
compiler options, if it has no interface it wont spawn a console.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Ram" <Ra*@discussion s.microsoft.com > wrote in message
news:78******** *************** ***********@mic rosoft.com...
I have a console application that brings up a dialog if invoked with no
command line parameters. If I double click on my application a console
window
is briefly displayed before the dialog appears (I have this code in my
app:

if (args.length ==0) FreeConsole() which causes the console to be closed)

Is there a way to prevent this console window from appearing in the first
place.

Jul 21 '05 #3

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

Similar topics

10
14738
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to in VB. I've created an ASP interface where a user can select an email group that populates a listbox with those email addresses. If a user sees an email in that list that they do not want then they can remove it by clinking the Delete button...
1
2584
by: James Carnley | last post by:
I am learning how to use windows forms and I have come across a small problem. Whenever I run my program it opens a console window before launching the windows form. The console doesnt go away until the program exits. When you use VS.net to make a windows application it makes a form without a console and I dont know why. What specifies whether a program starts with a console or not? I know that this code is probobly not right but I...
1
1789
by: Matt | last post by:
I have a console application with an UnhandledEvent handler and I believe it would work correctly if I could prevent the JIT Debugger from catching the problem first. How do I stop the JIT Debugger window from popping up? I know windows applications can have a flag set in the config file but I can't find anything like this for a console application. Thanks, Matt
2
260
by: Ram | last post by:
I have a console application that brings up a dialog if invoked with no command line parameters. If I double click on my application a console window is briefly displayed before the dialog appears (I have this code in my app: if (args.length ==0) FreeConsole() which causes the console to be closed) Is there a way to prevent this console window from appearing in the first place.
6
10434
by: Giojo | last post by:
Hello guys! I can't resolve this problem.. I want my programm in c# working with only console if there are some parameters, but if someone make double-click on the exe I want to start the graphic GUI without the black console on background.. Now I check if there are some parameters and if there aren't parameters I run the GUI (with the black console that remain..). If I choose Windows application on Visual Studio, when I run the...
5
9650
by: Paul | last post by:
Hi, I have a console app which is simply called from another app which passes a filename to it for processing. It does not display anything or require any input. All errors are sent to the eventlog. As this app is really just a wrapper for a class library I don't need it "popping" up on the console and would like it to be either invisible or for the console window to run minimized in the taskbar.
5
18598
by: thinktwice | last post by:
<package> <job id="js"> <script language="JScript"> var WshNetwork = WScript.CreateObject("WScript.Network"); var oDrives = WshNetwork.EnumNetworkDrives(); var oPrinters = WshNetwork.EnumPrinterConnections(); WScript.Echo("Domain = " + WshNetwork.UserDomain); WScript.Echo("Computer Name = " + WshNetwork.ComputerName); WScript.Echo("User Name = " + WshNetwork.UserName); WScript.Echo();
5
3493
by: Scott | last post by:
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")
12
6543
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow combination to hide the console window at launch time. The application (for legacy reasons) hangs around by waiting on an old- fashioned Console.ReadLine() statement.
0
9646
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.