private static void StartAsApplication() { SystemHost.StartService(); var ico = Resources.ServiceIcon; ms_TrayIcon = new NotifyIcon { Text = @"SCME.NetworkPrinting", Icon = new Icon(ico, ico.Width, ico.Height), ContextMenu = new ContextMenu(new[] { new MenuItem(@"Exit", OnExit) }), Visible = true }; Application.ApplicationExit += Application_ApplicationExit; Application.Run(); }
protected override void OnStart(string[] Args) { base.OnStart(Args); SystemHost.StartService(); }