473,396 Members | 1,724 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,396 software developers and data experts.

Write a program for modifying a file

Hello!!

I'm supposed to write a program that modify a file with data that has been
entered in the installation program(inno setup).

This program will start after the install file has been created.

When the program start that modify the file(s) I don't want the console
window to appear.
I just want the program to do what I have specified without having any kind
of output.

So my question is can I switch off the console window when the program run
or
is it any other possibilities.

When I develop the program I will use the console application but when I
deploy the program I want to remove
the console window.
So when the program is run you should not see anything as output to the
user.

//Tony
Nov 22 '07 #1
2 1268
Then build it as a windows exe; et voila, no console.

Marc
Nov 22 '07 #2
Hi Tony,

develop the application as a windows programm with
a invisible window and control its beahviour with a e.g.
command line option. Run the application hidden for no
user output and if you want a console, create a console
with the windows api AllocConsole(), use the standard
console output functions for the allocated console to
write and read from it and when you are done, just
do a Win api FreeConsole() to free the console. The
visibility of the console can be triggered with a command
line option, something like "yourapp.exe -c" or whatever
you want,...

Some Code:

[DllImport("kernel32.dll", SetLastError=true, ExactSpelling=true)]
static extern bool AllocConsole();

[DllImport("kernel32.dll", SetLastError=true, ExactSpelling=true)]
static extern bool FreeConsole();
AllocConsole();
Console.WriteLine("Some Console Output");
/*...Some code for reading or wirting from/to console
and when done do a FreeConsole()*/
FreeConsole();

Thats it!
Regards

Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
ke*****@arcor.de

Best Quote: "Ain't nobody a badass with a double dose
of rock salt...", Kill Bill Vol.2

Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
Sign my guestbook: http://entwicklung.junetz.de/guestbook/
-----------------------
"This reply is provided as is, without warranty express or implied."
Nov 22 '07 #3

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

Similar topics

6
by: haynesc | last post by:
Hi, I'm having a problem where when trying to open a file in write mode, I get an IOError stating no such file or directory. I'm calling an external program which takes an input file and...
2
by: Alexander Wehrli | last post by:
Hi, I embedded some configuration XML-File into my assembly. Everything goes fine if I want to read these Properties. But if I want to change a property, the runtime says me that this stream is...
3
by: WStoreyII | last post by:
Is There anyway to write to a file in a dll. Like lets say i packaged an xml file called customers as a resource in a dll is there any way that i could write to and or append the changes to it so...
3
by: Testguy | last post by:
Hi, I have been reading various messages in this group, and could not find an answer regarding what I am trying to do. At least, I could not find an easy answer. I am trying to figure out how...
10
by: jon | last post by:
I am a beginner C programmer, this is actually my first programming lanugage, besides html, cgi, and javascript. I am looking for a way to make an .exe file, or a copy of my own file. I have tried...
0
by: metaperl | last post by:
A Comparison of Python Class Objects and Init Files for Program Configuration ============================================================================= Terrence Brannon bauhaus@metaperl.com...
6
by: ulillillia | last post by:
I've been following the tutorial here to learn Windows programming (along with the help file from the Windows Platform SDK): http://www.cprogramming.com/tutorial/opengl_windows_programming.html ...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...
0
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,...

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.