I am trying to make my application load hidden when windows loads. I have created a shortcut with a parameter and I am trying to hide the form if the parameter equals to "WINDOWS". But the Form is ALWAYS shown regardless I hide the form or set the visibility to false. How do i get about doing this?
[MTAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
Debug.WriteLine("Arguments were passed");
foreach (string item in args)
{
MessageBox.Show(item);
}
Application.Run(new frmMain("WINDOWS"));
}
}
and in the constructor of frmMain
public frmMain(string Argument)
{
InitializeComponent();
if (Argument != null && Argument != "")
{
if (Argument == "WINDOWS")
{
this.Visible = false;
//Hide();
}
}
But the frmMain window is ALWAYS shown. How do make it load hidden?
Thanx a lot in advance :)