Closing Console Window from code.

  • Thread starter Thread starter Peter R. Fletcher
  • Start date Start date
P

Peter R. Fletcher

I believe that I need to use a Console Application because I need (for
various reasons) to pick up parameters passed to it on the "command
line" by another application that I didn't write and don't have the
source for. It doesn't seem to be possible to do this from a regular
Windows Application, though I would be delighted to be corrected if I
am wrong about this. I don't want or need the Console Window once the
program is started, but I haven't been able to work out how to
minimise or (even better) close it from program code while leaving the
Application running, interacting with the user, where necessary, via
Forms. Can anyone help?
 
Peter,

You can get the command line parameters via the
Environment.GetCommandLineArgs method. This method returns a string array of
the command line arguments for the application, so you are not limited to a
console application.

Gabriele


Peter R. Fletcher said:
I believe that I need to use a Console Application because I need (for
various reasons) to pick up parameters passed to it on the "command
line" by another application that I didn't write and don't have the
source for. It doesn't seem to be possible to do this from a regular
Windows Application, though I would be delighted to be corrected if I
am wrong about this. I don't want or need the Console Window once the
program is started, but I haven't been able to work out how to
minimise or (even better) close it from program code while leaving the
Application running, interacting with the user, where necessary, via
Forms. Can anyone help?


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
Back
Top