static void Main(string[] args) { Console.Title = "ffffff"; ConsoleWin32Helper.ShowNotifyIcon(); ConsoleWin32Helper.DisableCloseButton(Console.Title); Thread threadMonitorInput = new Thread(new ThreadStart(MonitorInput)); threadMonitorInput.Start(); while (true) { Application.DoEvents(); if (_IsExit) { break; } } }
/// <summary> /// 右键事件:退出程序 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void _NotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) { ConsoleWin32Helper.Show(Console.Title); MessageBox.Show("fdsafdsa"); }