I am building a concole based IRC bot, and would like to be able to hide it to the system tray. I am using the WinConsole class which allows me to hide/show the console window. And I have dynamically added a NotifyIcon to the project and it displays properly. I have dynamically created an event for it as well:
// tray icon
oIco.Icon = new System.Drawing.Icon(Directory.GetParent(System.Reflection.Assembly.GetEntryAssembly().Location) + @"\MainTray.ico");
oIco.Visible = true;
oIco.MouseClick += new System.Windows.Forms.MouseEventHandler(oIco_MouseClick);
My problem is the event doesn't fire, I have placed a break point in the event to test this. Is there a way to get a NotifyIcon's mouse events to work in a Console application project?