[Release] Hidden Console

12/03/2010 03:12 FuriousFang#31
On request, here's an example of how i handle my console and main statement:
Code:
[DllImport("user32.dll")]
        private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
        [DllImport("user32.dll")]
        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
        private static void StartForm() { Application.Run(new World()); }
        public static void WriteLine(string Text) { World.WriteLine(Text); }
        public static void WriteLine(Exception e) { World.WriteLine(e.ToString()); }

        private static void Main(string[] args)
        {
            Console.Title = "Conquer New Dawn: The Returning Light";
            Database.Configuration.Load();
            Database.Configuration.LoadMySQL();
            HideConsole();
            Database.Load.All();

            Handlers.Sockets.StartAuth();
            Handlers.Sockets.StartGame();
            WriteLine("\nThe server is ready for connections!");
        }

        private static void HideConsole()
        {
            Process window = Process.GetCurrentProcess();
            window.WaitForInputIdle();
            IntPtr hWnd = FindWindow(null, "Conquer New Dawn: The Returning Light");
            if (hWnd != IntPtr.Zero)
                ShowWindow(hWnd, 0);
            Thread Start = new Thread(100);
            Start.Execute += new Action(StartForm);
        }
12/04/2010 05:03 FangsBiggestFan#32
OMG, Fang I can't believe I'm actually on the same thread as you. It feels like I'm talking to a superstar or something. Dude, you make the best releases. Your my favorite coder, you code the best stuff EVER. Good job man keep doing what your doing bro. Please give me your MSN so I can talk to you. I love you brooo
12/04/2010 09:13 FuriousFang#33
Quote:
Originally Posted by FangsBiggestFan View Post
OMG, Fang I can't believe I'm actually on the same thread as you. It feels like I'm talking to a superstar or something. Dude, you make the best releases. Your my favorite coder, you code the best stuff EVER. Good job man keep doing what your doing bro. Please give me your MSN so I can talk to you. I love you brooo
I don't know which one of you it is but damn. :facepalm:
If you think I look at myself in that way then you have a serious social problem.
12/05/2010 01:14 BioHazarxPaul#34
Quote:
Originally Posted by FangsBiggestFan View Post
OMG, Fang I can't believe I'm actually on the same thread as you. It feels like I'm talking to a superstar or something. Dude, you make the best releases. Your my favorite coder, you code the best stuff EVER. Good job man keep doing what your doing bro. Please give me your MSN so I can talk to you. I love you brooo
that doesn't just shout out hey I am trying to act like someone I am not normally..
12/05/2010 01:40 Syst3m_W1z4rd#35
This is not even close to be CO2 related o.O