Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making an application that is supposed to start when windows starts. I have added the path to the exe file in the registry to achive this, and it works as intended. When the application starts the main form is minimized in it's contructor, and a NotifyIcon is shown in the systray. The problem is that sometimes the NotifyIcon does not appear in the systray, but when i look at the processlist in the task manager i can see that the application is running.

So far this is the only code in the application

C#
public Form1()
{
    InitializeComponent();

    notifyIcon1.Text = "Tray icon test";
    WindowState = FormWindowState.Minimized;
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
    notifyIcon1.Visible = false;
    this.Close();
}


I think it could have something to do with the systray sometimes not being "ready" when the application starts.

Any suggestions to what could cause this behavior?
Posted
Updated 12-Aug-10 1:55am
v2
Comments
Per Söderlund 12-Aug-10 9:13am    
I have the same problem with a WPF program.
When it auto starts on Windows startup it wont load the config file (.xml)
but if i close it and start it up again it reads the xmlfile just fine.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900