How to minimize application to tray by using command line argument
===

How can i minimize application to system tray by using command line argument.

eg:when i open my application using command line like this.
c:\myfile.exe totray

i writed some code for that but it never worked.

    static void Main(string[] args)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                if (args.Length >0)
                {
                    MessageBox.Show(args[0]);
                }
                Application.Run(new Form1());
               
            }

Here the messagebox is showing with my argument "totray".
so i just added code like 

    static void Main(string[] args)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                if (args.Length >0)
                {
                   // MessageBox.Show(args[0]);
                    if (args[0] == "totray") {
                        Form1 frm1 = new Form1();
                        frm1.Hide();
                    }
                }
                Application.Run(new Form1());
               
            }

But this idea is not working.
is it possible to do get the argument to the form?
what code i need to write here?

