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

Window and console application all in one

Hello everyone,
I'm have a window application, but it is a console application
too. I'll try to explain better: if I call the program without
parameters the GUI starts. Otherwise it runs as a console application.
In other words, I emulate the "certmgr" behavior.
My problem is I cannot display any trace in the console (Someghing
like: Pass 1: OK, Pass 2: etc). Console.Write does not work, because
the window application has not a console. Is there any method to show
redirect the input to the console? Please could you give me any
example?

Thanks all, Gionni
Jul 21 '05 #1
3 2105
Hi, Gionni

compile application as Console project. It will do the trick.
In Main check if arguments are present and act accordingly.

HTH
Alex

"Gionni" <eh*******@katamail.com> wrote in message
news:d9**************************@posting.google.c om...
Hello everyone,
I'm have a window application, but it is a console application
too. I'll try to explain better: if I call the program without
parameters the GUI starts. Otherwise it runs as a console application.
In other words, I emulate the "certmgr" behavior.
My problem is I cannot display any trace in the console (Someghing
like: Pass 1: OK, Pass 2: etc). Console.Write does not work, because
the window application has not a console. Is there any method to show
redirect the input to the console? Please could you give me any
example?

Thanks all, Gionni

Jul 21 '05 #2
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message news:<OO**************@tk2msftngp13.phx.gbl>...
compile application as Console project. It will do the trick.
In Main check if arguments are present and act accordingly.
Thanks, I tested it and works.
Only one thing more. Is there any way to make the command prompt
disappear when I do a double click on my application?
HTH
Alex


Thanks again, Gionni
Jul 21 '05 #3
Hi, Gionni

You can do this if you get console window handle and hide it using win32
API. Look for GetConsoleWindow and ShowWindow functions in platform SDK or
on MSDN. You need to get handle of console and do ShowWindow on it with
SW_HIDE parameter. Declarations for functions you can find on
www.pinvoke.net and on several other sites.

HTH
Alex

"Gionni" <eh*******@katamail.com> wrote in message
news:d9*************************@posting.google.co m...
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message

news:<OO**************@tk2msftngp13.phx.gbl>...
compile application as Console project. It will do the trick.
In Main check if arguments are present and act accordingly.


Thanks, I tested it and works.
Only one thing more. Is there any way to make the command prompt
disappear when I do a double click on my application?
HTH
Alex


Thanks again, Gionni

Jul 21 '05 #4

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

Similar topics

4
by: Jason Callas | last post by:
I am trying to figure out how to create a console window but cannot figure out how to do this. I know it can be done since the C# and VB console template projects do this but I see no code on how...
1
by: gemel | last post by:
I am debugging code that writes to the console window, I select an appropriate line and the select 'Run to Cursor'. The console output does appear and then the window closes. How can I keep this...
8
by: Mészáros Tamás | last post by:
Hi all, how can I set an app's main window to visible from an other application? My problem is, that I know only the handle of the other app's main process, because the application's main window...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
12
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...
2
by: ssg31415926 | last post by:
Is it possible to create a console app that doesn't display a window? I want to create an app which runs before the main app and starts it in another process and I don't want the console box to...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.