Hello everybody ...
Now I'm creating a C# program and it seems everything is fine ...
My program is a backend service one and so I don't need any interface ...
It takes 10+ seconds to perform its task ...
My problem is ... when I run that program ... the MS-DOS Screen (the black screen with no text at all) is opening until the end of the program ...
Can you pls help me to advise why this happen and how can I prevent it?
Thanks a lot ...
Mg Mg Sa
Loading
Zaw Min TunPosted Oct 21, 2009, 12:14 AM
I tried the code ...
But the window still opens ...
But your code segments give me a great hint ...
I used your code segment as searching and found an answer here ...
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ea8b0fd5-a660-46f9-9dcb-d525cc22dcbd
Thanks a lot for leading me to a good point ...
Best regards ...
Mg Mg Sa
Kirtan PatelPosted Oct 20, 2009, 11:11 PM
Hide Your Console Window With Following Code
if my answer helps you check "Do you like this answer" please :)
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern IntPtr ShowWindow(string WindowName, int ShowFlag);
static void Main(string[] args)
{
//Hide Window
Console.Title = "UniqTitle";
ShowWindow(Console.Title, 0);
}