public ThreadStarter() { if (_instance != null) { return; } _instance = this; }
private void menuExit_Click(object sender, EventArgs e) { ThreadStarter.ClearLog(); this.ShowInTaskbar = false; this.notifyIcon1.Visible = false; this.Close(); this.Dispose(true); Application.ExitThread(); }
private void Form1_Load(object sender, EventArgs e) { if (arg != null) { //arg不为空,说明有启动参数,是从注册表启动的,则直接最小化到托盘 this.Visible = false; this.ShowInTaskbar = false; } start = new ThreadStarter(); start.MessageSend += new ThreadStarter.MessageEventHandler(this.EventHandler); start.StartThread(); }