public TrayIcon() { _trayIcon = new System.Windows.Forms.NotifyIcon(); _trayIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); var aboutString = EarTrumpet.Properties.Resources.ContextMenuAboutTitle; var version = Assembly.GetEntryAssembly().GetName().Version; _trayIcon.ContextMenu.MenuItems.Add(String.Format("{0} Ear Trumpet {1} ...", aboutString, version)); _trayIcon.ContextMenu.MenuItems[0].Click += About_Click; _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuShowDesktopAppsTitle); _trayIcon.ContextMenu.MenuItems[1].Checked = UserPreferencesService.ShowDesktopApps; _trayIcon.ContextMenu.MenuItems[1].Click += ShowDesktopApps_Click; _trayIcon.ContextMenu.MenuItems.Add("-"); _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuExitTitle); _trayIcon.ContextMenu.MenuItems[3].Click += Exit_Click; _trayIcon.MouseClick += TrayIcon_MouseClick; _trayIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/EarTrumpet;component/Tray.ico")).Stream); var tooltipString = EarTrumpet.Properties.Resources.ContextMenuTooltip; _trayIcon.Text = String.Format("Ear Trumpet - {0}", tooltipString); _trayIcon.Visible = true; }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.Icon = global::StickyNotesWall.Resource1.favicon; this.notifyIcon1.Text = "Ocean Notes\' Wall"; this.notifyIcon1.Visible = true; this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1MouseClick); // // StartingWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(314, 62); this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Icon = global::StickyNotesWall.Resource1.favicon; this.Name = "StartingWindow"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "StartingWindow"; this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.ResumeLayout(false); }
private void InternClose() { _newsMachine.CloseOverlay(true); _newsMachine = null; notifyIcon.Dispose(); notifyIcon = null; }
public MainWindow() { InitializeComponent(); TasktrayIcon = new NotifyIcon { Text = "Kbtter", Visible = true, Icon = new Icon("trayicon.ico") }; Player = new MediaPlayer(); UploadImagePath = new Dictionary<string, Stream>(); UploadImageDialog = new OpenFileDialog(); UploadImageDialog.AddExtension = true; UploadImageDialog.Multiselect = true; UploadImageDialog.Title = "アップロードする画像を選択"; UploadImageDialog.Filter = "対応している画像ファイル|*.png;*.jpg;*.jpeg;*.gif|PNGイメージ|*.png|JPEGイメージ|*.jpg;*.jpeg|GIFイメージ|*.gif"; IronPythonEngine = Python.CreateEngine(); IronPythonEngine.Runtime.LoadAssembly(this.GetType().Assembly); IronPythonEngine.Runtime.LoadAssembly(Assembly.LoadFrom("TweetSharp.dll")); TweetPlugins = new List<IKbtterOnTweet>(); RetweetPlugins = new List<IKbtterOnRetweet>(); FavoritePlugins = new List<IKbtterOnFavorite>(); UnfavoritePlugins = new List<IKbtterOnUnfavorite>(); InitializePlugins = new List<IKbtterOnInitialize>(); WindowPlugins = new List<IKbtterCallable>(); Settings = new Config(); }
public Window1() { InitializeComponent(); _systemtray = new System.Windows.Forms.NotifyIcon(); Assembly a = Assembly.GetExecutingAssembly(); Stream logoStream = a.GetManifestResourceStream("YAWAMT.SystemTrayClient.yawamt.ico"); _systemtray.Icon = new System.Drawing.Icon(logoStream); _systemtray.Visible = true; _systemtray.Click += new EventHandler(SystemTrayIcon_Click); _systemtray.MouseMove += new System.Windows.Forms.MouseEventHandler(SystemTrayIcon_MouseMove); _systemtray.BalloonTipShown += new EventHandler(SystemTrayIcon_BalloonTipShown); _systemtray.BalloonTipClosed += new EventHandler(SystemTrayIcon_BalloonTipClosed); _systemtray.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; _systemtray.BalloonTipTitle = "yawamt"; _systemtray.BalloonTipText = "3 down, 5 up"; AttachContextMenu(); try { IconBitmapDecoder decoder = new IconBitmapDecoder(logoStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); imglogo.Source = decoder.Frames[0]; } catch { } this.Hide(); //if (string.IsNullOrEmpty(YAWAMT.SystemTrayClient.Properties.Settings.Default.Url)) // ContextMenuSettings(this, EventArgs.Empty); }
private void CreateNotificationIcon() { DestroyNotificationIcon(); _notifyIcon = new System.Windows.Forms.NotifyIcon { BalloonTipTitle = Properties.Resources.NotifierTitle, Text = Properties.Resources.NotifierTitle }; var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("GoogleCalendarReminder.Resources.calendar.ico"); if (stream != null) { _notifyIcon.Icon = new Icon(stream); } _notifyIcon.DoubleClick += NotifyIconClick; _notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Refresh Calendars", OnRefresh)); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Upcoming Events...", OnUpcomingEvents)); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Settings...", new EventHandler(OnSettings))); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("View Project Page...", OnLaunchProjectPage)); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("View Issue Log...", OnViewLog)); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("About...", OnAbout)); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-")); _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", OnExit)); _notifyIcon.Visible = true; }
public void InitializeBackend(object frontend) { statusIcon = new System.Windows.Forms.NotifyIcon (); //TODO: expose Visible property in the StatusIcon class statusIcon.Visible = true; }
public static void Start(EventHandler onShow, EventHandler onClose, EventHandler onShowLogs) { RefreshTaskbarNotificationArea(); AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit); _notifyIcon = new System.Windows.Forms.NotifyIcon(); Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/ServerFS2;component/FS2.ico")).Stream; _notifyIcon.Icon = new System.Drawing.Icon(iconStream); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); var menuItem1 = new System.Windows.Forms.MenuItem(); menuItem1.Text = "Показать"; menuItem1.Click += new EventHandler(onShow); _notifyIcon.ContextMenu.MenuItems.Add(menuItem1); var menuItem2 = new System.Windows.Forms.MenuItem(); menuItem2.Text = "Выход"; menuItem2.Click += new EventHandler(onClose); _notifyIcon.ContextMenu.MenuItems.Add(menuItem2); var menuItem3 = new System.Windows.Forms.MenuItem(); menuItem3.Text = "Логи"; menuItem3.Click += new EventHandler(onShowLogs); _notifyIcon.ContextMenu.MenuItems.Add(menuItem3); _notifyIcon.Text = "Сервер FS2"; }
public ServerWindow() { InitializeComponent(); Closing += ServerWindow_Closing; isConfigured = false; isConnected = false; isServerActive = false; passwordChanged = false; notifyServer = new System.Windows.Forms.NotifyIcon(); notifyServer.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyServer_mouseClickEvent); notifyServer.MouseMove += new System.Windows.Forms.MouseEventHandler(notifyServer_MouseMove); path = Directory.GetCurrentDirectory().Remove(Directory.GetCurrentDirectory().Length - 9); notifyServer.Icon = new System.Drawing.Icon(path + "\\Punto_rosso.ico"); status = new StatusWindow(this); this.WindowState = WindowState.Normal; this.ShowInTaskbar = true; //cosi non compare l'icona notifyServer.Visible = true; notifyServer.BalloonTipTitle = "Server AVVIATO"; notifyServer.BalloonTipText = "Caricate le impostazioni di default\nPremi START per mettere il server in attesa di connessioni"; notifyServer.ShowBalloonTip(300); connectionParameter = new ConnectionParameter(); dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); //questo metodo mi serve per inserire tutti gli indirizzi presente sulla macchina server caricaInfoIndirizzoServer(); caricaInfoTextBox(); stopButton.IsEnabled = false; stateLabel.Content = NON_CONNESSO; contHour = 0; contMin = 0; contSec = 0; }
public MainWindow() { InitializeComponent(); this.IsPostPanelExpand = true; this.IsFunctionPanelExpand = true; this.IsMessagePostPanelExpand = true; this.AuthPanel.OkButton.Click += new RoutedEventHandler(OkButton_Click); this.AuthPanel.PrevButton.Click += new RoutedEventHandler(PrevButton_Click); this.AuthPanel.NextButton.Click += new RoutedEventHandler(NextButton_Click); this.ReplyPanel.ReplyButton.Click += new RoutedEventHandler(ReplyPanelReplyButton_Click); this.ReplyPanel.CancelButton.Click += new RoutedEventHandler(ReplyPanelCancelButton_Click); #region Task Tray int ScreenWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width; int Screenheigth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height; int AppWidth = (int)this.Width; int AppHeight = (int)this.Height; Canvas.SetLeft(this, ScreenWidth - AppWidth); //ScreenWidth / 2 - AppWidth / 2; Canvas.SetTop(this, Screenheigth - AppHeight); //Screenheigth / 2 - AppHeight / 2; this.StateChanged += new EventHandler(MainWindow_StateChanged); this.taskIcon = new System.Windows.Forms.NotifyIcon(); this.taskIcon.Visible = true; this.taskIcon.Icon = Properties.Resources.YammyyIcon; this.taskIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(taskIcon_MouseClick); this.taskIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem item = new System.Windows.Forms.MenuItem("&Exit", taskIconItemExit_Click); this.taskIcon.ContextMenu.MenuItems.Add(item); #endregion System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(InitialCheck)); th.Start(); }
public MainWindow() { InitializeComponent(); _myNotifyIcon = new System.Windows.Forms.NotifyIcon {Icon = new System.Drawing.Icon("rss.ico")}; _myNotifyIcon.MouseDoubleClick += (a, b) => WindowState = WindowState.Normal; _myNotifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu( new[] { new MenuItem("Open", (a, b) => WindowState = WindowState.Normal), new MenuItem("-"), new MenuItem( "Exit", (a, b) => { _myNotifyIcon.Visible = false; Close(); }) }); PopulateQualities(); _localIp = Dns.GetHostEntry(Dns.GetHostName()). AddressList.First(ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString(); var address = Settings.Default.OverrideNetworkSettings ? Settings.Default.HostName : _localIp; var port = Settings.Default.OverrideNetworkSettings ? Settings.Default.PortNumber : DefaultPort; IpAddressLabel.Text = address; PortLabel.Text = port; _baseAddress = string.Format(_baseAddress, address, port); Generate.Content = "Generate & Copy URL"; }
void Init() { this.notifyIcon = new System.Windows.Forms.NotifyIcon(); //this.notifyIcon.BalloonTipText = "你好, 欢迎使用随身袋!"; this.notifyIcon.Text = window.Title; this.notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.IO.Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, AppDomain.CurrentDomain.SetupInformation.ApplicationName)); this.notifyIcon.Visible = true; this.notifyIcon.DoubleClick += new EventHandler(delegate { if (window.Top < 0) { window.Top = 1; } window.Topmost = true; window.Show(); window.WindowState = wsl; }); this.notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); AddMenuItem("打开随身袋", delegate { if (window.Top < 0) { window.Top = 1; } window.Topmost = true; window.Show(); window.WindowState = wsl; }); this.notifyIcon.ContextMenu.MenuItems.Add("-"); AddMenuItem("退出",delegate { IsCanClose = true; window.Close(); }); //this.notifyIcon.ShowBalloonTip(1000); }
public LogAndErrorsUtils(System.Windows.Forms.NotifyIcon notifyIcon, System.Windows.Forms.ToolTipIcon tooltypeIcon) { m_logger = LogManager.GetCurrentClassLogger(); m_notifyIcon = notifyIcon; m_tooltypeIcon = tooltypeIcon; m_bFirstError = false; }
public MainWindow() { InitializeComponent(); ping = new Ping(); ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = System.Drawing.Icon.FromHandle(Properties.Resources.plug.GetHicon()); ni.Visible = true; ni.DoubleClick += delegate (object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; intervalTextBox.Text = Properties.Settings.Default.interval; address1TextBox.Text = Properties.Settings.Default.addy1; address2TextBox.Text = Properties.Settings.Default.addy2; address3TextBox.Text = Properties.Settings.Default.addy3; statusLabel.Content = ""; address1ResLabel.Content = ""; address2ResLabel.Content = ""; address3ResLabel.Content = ""; timer = new DispatcherTimer(); timer.Tick += new EventHandler(TimedEvent); }
public Main() { InitializeComponent(); if (isDebug.Equals("false")) this.Topmost = true; this.notifyIcon = new System.Windows.Forms.NotifyIcon(); this.notifyIcon.BalloonTipText = "多电站演示系统正在运行!"; this.notifyIcon.Text = "多电站演示系统!"; this.notifyIcon.Icon = new System.Drawing.Icon("favicon.ico"); this.notifyIcon.Visible = true; this.notifyIcon.ShowBalloonTip(1000); this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick); System.Windows.Forms.MenuItem showWindow = new System.Windows.Forms.MenuItem("显示界面"); showWindow.Click += new EventHandler(showWindow_Click); System.Windows.Forms.MenuItem exitSystem = new System.Windows.Forms.MenuItem("退出"); exitSystem.Click += new EventHandler(exitSystem_Click); System.Windows.Forms.MenuItem[] menuItems = new System.Windows.Forms.MenuItem[] { showWindow, exitSystem }; this.notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(menuItems); this.StateChanged += new EventHandler(MainWindow_StateChanged); setHook(); autoRun(); //GC.Collect(); //GC.WaitForPendingFinalizers(); //GC.Collect(); }
public TrayIcon() { _trayIcon = new System.Windows.Forms.NotifyIcon(); _trayIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); _audioDeviceService = new EarTrumpetAudioDeviceService(); var aboutString = Properties.Resources.ContextMenuAboutTitle; var version = Assembly.GetEntryAssembly().GetName().Version; var deviceSep = _trayIcon.ContextMenu.MenuItems.Add("-"); deviceSep.Name = _deviceSeparatorName; var feedbackItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuSendFeedback); feedbackItem.Click += Feedback_Click; var aboutItem = _trayIcon.ContextMenu.MenuItems.Add(String.Format("{0} Ear Trumpet {1} ...", aboutString, version)); aboutItem.Click += About_Click; var exitItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuExitTitle); exitItem.Click += Exit_Click; _trayIcon.MouseClick += TrayIcon_MouseClick; _trayIcon.ContextMenu.Popup += ContextMenu_Popup; _trayIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/EarTrumpet;component/Tray.ico")).Stream); _trayIcon.Text = string.Concat("Ear Trumpet - ", EarTrumpet.Properties.Resources.TrayIconTooltipText); _trayIcon.Visible = true; }
public Main() { InitializeComponent(); System.Windows.Forms.ContextMenu systemTrayContextMenu = new System.Windows.Forms.ContextMenu(); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Reports", new EventHandler(Reports_Click))); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Settings", new EventHandler(Settings_Click))); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", new EventHandler(Exit_Click))); SystemTrayIcon = new System.Windows.Forms.NotifyIcon(); SystemTrayIcon.ContextMenu = systemTrayContextMenu; SystemTrayIcon.Visible = true; SystemTrayIcon.Icon = new Icon(SystemIcons.Application, 40, 40); SystemTrayIcon.Text = "Slacking off"; SystemTrayIcon.BalloonTipTitle = "Get Back To Work"; SystemTrayIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; SystemTrayIcon.Click += new EventHandler(SystemTrayIcon_Click); Hide(); Left = System.Windows.SystemParameters.PrimaryScreenWidth - Width - 5; Top = 5; DateStarted = null; LoadSettings(); }
/// <summary> /// Initializes the trayicon and the contextmenu /// </summary> public static void InitializeTrayIcon() { // Initialize objects and tray icon NotifyIcon = new System.Windows.Forms.NotifyIcon(); NotifyIcon.Text = "Sun Plasma"; NotifyIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); NotifyIcon.DoubleClick += new EventHandler(NotifyIcon_Click); NotifyIcon.Visible = true; // Set up the context menu for the notify icon NotifyContextMenu = new System.Windows.Forms.ContextMenu(); // Launch Star Citizen var launchStarCitizenItem = NotifyContextMenu.MenuItems.Add("Launch Star Citizen"); var command = new ViewModel.Commands.LaunchStarCitizenCommand(); launchStarCitizenItem.Enabled = command.CanExecute(null); launchStarCitizenItem.Click += (sender, args) => command.Execute(null); // Launch Mumble var launchMumble = NotifyContextMenu.MenuItems.Add("Launch Mumble"); var commandMumble = new ViewModel.Commands.LaunchMumbleCommand(); launchMumble.Enabled = commandMumble.CanExecute(null); launchMumble.Click += (sender, args) => commandMumble.Execute(null); // Exit NotifyContextMenu.MenuItems.Add("-"); NotifyContextMenu.MenuItems.Add("Exit", NotifyContextMenuExit_Click); NotifyIcon.ContextMenu = NotifyContextMenu; }
public MainWindow() { InitializeComponent(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); System.IO.Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Icons/App.ico")).Stream; ni.Icon = new System.Drawing.Icon(iconStream); ni.Visible = true; ni.DoubleClick += delegate (object sender, EventArgs args) { Show(); WindowState = WindowState.Normal; }; // and hide Hide(); // register to run at startup RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (rkApp.GetValue("MachMultimediaKeysMapper") == null) { rkApp.SetValue("MachMultimediaKeysMapper", System.Reflection.Assembly.GetExecutingAssembly().Location); } }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.tb_Content = new System.Windows.Forms.TextBox(); this.b_Copy = new System.Windows.Forms.Button(); this.b_Clear = new System.Windows.Forms.Button(); this.ni_Tray = new System.Windows.Forms.NotifyIcon(this.components); this.SuspendLayout(); // // tb_Content // this.tb_Content.Location = new System.Drawing.Point(12, 12); this.tb_Content.Multiline = true; this.tb_Content.Name = "tb_Content"; this.tb_Content.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.tb_Content.Size = new System.Drawing.Size(418, 270); this.tb_Content.TabIndex = 0; // // b_Copy // this.b_Copy.Location = new System.Drawing.Point(355, 288); this.b_Copy.Name = "b_Copy"; this.b_Copy.Size = new System.Drawing.Size(75, 23); this.b_Copy.TabIndex = 1; this.b_Copy.Text = "Копировать"; this.b_Copy.UseVisualStyleBackColor = true; this.b_Copy.Click += new System.EventHandler(this.B_CopyClick); // // b_Clear // this.b_Clear.Location = new System.Drawing.Point(274, 288); this.b_Clear.Name = "b_Clear"; this.b_Clear.Size = new System.Drawing.Size(75, 23); this.b_Clear.TabIndex = 1; this.b_Clear.Text = "Очистить"; this.b_Clear.UseVisualStyleBackColor = true; this.b_Clear.Click += new System.EventHandler(this.B_ClearClick); // // ni_Tray // this.ni_Tray.Text = "Накопитель Буфера Обмена"; this.ni_Tray.Visible = true; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(445, 325); this.Controls.Add(this.b_Clear); this.Controls.Add(this.b_Copy); this.Controls.Add(this.tb_Content); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainForm"; this.Text = "Накопитель Буфера"; this.ResumeLayout(false); this.PerformLayout(); }
void 显示托盘() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Text = "微信"; notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location); notifyIcon.Visible = true; notifyIcon.MouseClick += OnNotifyIconClick; }
public MainWindow(System.Windows.Forms.NotifyIcon notifyIcon) { this.InitializeComponent(); this.notifyIcon = notifyIcon; // Insert code required on object creation below this point. CreateListeners(); }
public static void Stop() { if (_notifyIcon != null) { _notifyIcon.Visible = false; _notifyIcon.Dispose(); _notifyIcon = null; } }
public MainWindow() { InitializeComponent(); MyNotifyIcon = new System.Windows.Forms.NotifyIcon(); MyNotifyIcon.Icon = Properties.Resources.icon; MyNotifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(MyNotifyIcon_MouseDoubleClick); MyNotifyIcon.Visible = true; MyNotifyIcon.Text = "OSAE.Voice"; }
private void SetupTrayIcon() { var notifyIcon = new System.Windows.Forms.NotifyIcon { Icon = new Icon("Icon.ico"), Visible = true }; notifyIcon.DoubleClick += notifyIcon_DoubleClick; }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.tb_Content = new System.Windows.Forms.TextBox(); this.b_Copy = new System.Windows.Forms.Button(); this.b_Clear = new System.Windows.Forms.Button(); this.ni_Tray = new System.Windows.Forms.NotifyIcon(this.components); this.SuspendLayout(); // // tb_Content // this.tb_Content.Location = new System.Drawing.Point(12, 12); this.tb_Content.Multiline = true; this.tb_Content.Name = "tb_Content"; this.tb_Content.Size = new System.Drawing.Size(656, 297); this.tb_Content.TabIndex = 0; // // b_Copy // this.b_Copy.Location = new System.Drawing.Point(593, 315); this.b_Copy.Name = "b_Copy"; this.b_Copy.Size = new System.Drawing.Size(75, 23); this.b_Copy.TabIndex = 1; this.b_Copy.Text = "Копировать"; this.b_Copy.UseVisualStyleBackColor = true; this.b_Copy.Click += new System.EventHandler(this.B_CopyClick); // // b_Clear // this.b_Clear.Location = new System.Drawing.Point(512, 315); this.b_Clear.Name = "b_Clear"; this.b_Clear.Size = new System.Drawing.Size(75, 23); this.b_Clear.TabIndex = 1; this.b_Clear.Text = "Очистить"; this.b_Clear.UseVisualStyleBackColor = true; this.b_Clear.Click += new System.EventHandler(this.B_ClearClick); // // ni_Tray // this.ni_Tray.Text = "Буфер Обмена"; this.ni_Tray.Visible = true; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(680, 349); this.Controls.Add(this.b_Clear); this.Controls.Add(this.b_Copy); this.Controls.Add(this.tb_Content); this.Name = "MainForm"; this.Text = "tray"; this.ResumeLayout(false); this.PerformLayout(); }
private void InitIcon() { Icon = new System.Windows.Forms.NotifyIcon(); Icon.MouseUp += Icon_MouseUp; Icon.DoubleClick += Icon_DoubleClick; Icon.BalloonTipClicked += Icon_BalloonTipClicked; Icon.Icon = new System.Drawing.Icon("Resources\\SysTray.ico"); Icon.Text = Settings.Default.forumName; Icon.Visible = true; }
public void ShowNotification(String message) { var notification = new System.Windows.Forms.NotifyIcon() { Visible = true, Icon = System.Drawing.SystemIcons.Information, BalloonTipText = message, }; notification.ShowBalloonTip(60); }
public NotificationTrayIcon(ITradePriceMonitorContextMenu contextMenu) { _contextMenu = contextMenu; _notifyIcon = new System.Windows.Forms.NotifyIcon { Visible = true, ContextMenu = _contextMenu.Menu, Icon = CreateIconImage("-") }; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShareWatcher)); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.monitoringEnabledMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenu.SuspendLayout(); this.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.ContextMenuStrip = this.contextMenu; this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "MyFilms Share Watcher"; this.notifyIcon1.Visible = true; // // contextMenu // this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.monitoringEnabledMenuItem, this.closeMenuItem}); this.contextMenu.Name = "contextMenuStrip1"; this.contextMenu.Size = new System.Drawing.Size(216, 70); // // monitoringEnabledMenuItem // this.monitoringEnabledMenuItem.Checked = true; this.monitoringEnabledMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.monitoringEnabledMenuItem.Name = "monitoringEnabledMenuItem"; this.monitoringEnabledMenuItem.Size = new System.Drawing.Size(215, 22); this.monitoringEnabledMenuItem.Text = "Monitoring Enabled"; this.monitoringEnabledMenuItem.Click += new System.EventHandler(this.monitoringEnabledMenuItem_Click); // // closeMenuItem // this.closeMenuItem.Name = "closeMenuItem"; this.closeMenuItem.Size = new System.Drawing.Size(215, 22); this.closeMenuItem.Text = "Close Music Share Watcher"; // // ShareWatcher // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(412, 178); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "ShareWatcher"; this.ShowInTaskbar = false; this.Text = "MyFilms Share Watcher"; this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.Resize += new System.EventHandler(this.OnResize); this.contextMenu.ResumeLayout(false); this.ResumeLayout(false); }
private System.Windows.Forms.NotifyIcon InitTrayIcon() { var appName = Properties.Resources.ApplicationName; var trayIcon = new System.Windows.Forms.NotifyIcon() { BalloonTipText = appName, Text = appName, Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath) /*读取程序图标,来作为托盘图标*/ }; trayIcon.MouseClick += TrayIcon_MouseClick; var contextMenu = new System.Windows.Forms.ContextMenuStrip { BackColor = Color.FromArgb(255, 62, 62, 66), ForeColor = Color.White, }; var item = new System.Windows.Forms.ToolStripMenuItem("查看日志") { BackgroundImage = Properties.Resources.BackIcon, Image = Properties.Resources.LookIcon, ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.SizeToFit, }; item.Click += (sender, e) => { var path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, @"Log\NotesLog.xml"); if (File.Exists(path)) { Process.Start("notepad.exe", path); } else { Extentions.ShowMessageBox("找不到日志文件!"); } }; contextMenu.Items.Add(item); item = new System.Windows.Forms.ToolStripMenuItem("退出") { BackgroundImage = Properties.Resources.BackIcon, Image = Properties.Resources.CloseIcon, ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.SizeToFit, }; item.Click += (sender, e) => { Close(); }; contextMenu.Items.Add(item); trayIcon.ContextMenuStrip = contextMenu; trayIcon.ShowBalloonTip(500);//设置显示提示气球时间 trayIcon.Visible = true; return(trayIcon); }
private void SetupNotifyIconIcon() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Icon = new System.Drawing.Icon(@"./AppIcon.ico"); notifyIcon.MouseDoubleClick += OnNotifyIconDoubleClick; notifyIconContextMenu = new System.Windows.Forms.ContextMenu(); notifyIconContextMenu.MenuItems.Add("E&xit"); notifyIconContextMenu.MenuItems[0].Click += OnExitNotifyIconClick; notifyIcon.ContextMenu = notifyIconContextMenu; }
private static void SetupTrayIcon(string logFileName) { // Create tray icon var components = new System.ComponentModel.Container(); var notifyIcon = new System.Windows.Forms.NotifyIcon(components); notifyIcon.Text = "Stride Connection Router"; notifyIcon.Icon = Properties.Resources.Logo; notifyIcon.Visible = true; var contextMenu = new System.Windows.Forms.ContextMenuStrip(components); if (!string.IsNullOrEmpty(logFileName)) { var showLogMenuItem = new System.Windows.Forms.ToolStripMenuItem("Show &Log"); showLogMenuItem.Click += (sender, args) => OnShowLogClick(logFileName); contextMenu.Items.Add(showLogMenuItem); notifyIcon.BalloonTipClicked += (sender, args) => OnShowLogClick(logFileName); } var openConsoleMenuItem = new System.Windows.Forms.ToolStripMenuItem("Open Console"); openConsoleMenuItem.Click += (sender, args) => OnOpenConsoleClick((System.Windows.Forms.ToolStripMenuItem)sender); contextMenu.Items.Add(openConsoleMenuItem); var exitMenuItem = new System.Windows.Forms.ToolStripMenuItem("E&xit"); exitMenuItem.Click += (sender, args) => OnExitClick(); contextMenu.Items.Add(exitMenuItem); notifyIcon.ContextMenuStrip = contextMenu; GlobalLogger.GlobalMessageLogged += (logMessage) => { // Log only warning, errors and more if (logMessage.Type < LogMessageType.Warning) { return; } var toolTipIcon = logMessage.Type < LogMessageType.Error ? System.Windows.Forms.ToolTipIcon.Warning : System.Windows.Forms.ToolTipIcon.Error; // Display notification (for two second) notifyIcon.ShowBalloonTip(2000, "Stride Connection Router", logMessage.ToString(), toolTipIcon); }; System.Windows.Forms.Application.ApplicationExit += (sender, e) => { notifyIcon.Visible = false; notifyIcon.Icon = null; notifyIcon.Dispose(); }; }
private void CreateNotifyIcon() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Click += (s, args) => ShowMainWindow(); notifyIcon.Icon = TrayIcon.Properties.Resources.MyIcon; notifyIcon.Visible = true; notifyIcon.ContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); notifyIcon.ContextMenuStrip.Items.Add("Mouse settings").Click += (s, e) => ShowMainWindow(); notifyIcon.ContextMenuStrip.Items.Add("Exit").Click += (s, e) => ExitApplication(); }
public static void HideNotifyIcon() { if (NOTIFY_ICON == null) { return; } NOTIFY_ICON.Visible = false; NOTIFY_ICON.Dispose(); NOTIFY_ICON = null; }
private void setTrayIcon() { Icon trayIcon; if (SystemParameters.SmallIconWidth > 16) { trayIcon = Properties.Resources.ic_tray32; } else { trayIcon = Properties.Resources.ic_tray16; } notify = new System.Windows.Forms.NotifyIcon(); notify.Text = "Sound Mixer Remote"; notify.Icon = trayIcon; notify.Visible = true; notify.MouseClick += (object sender, System.Windows.Forms.MouseEventArgs e) => { if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (isOpen) { closeToTray(); } else { restoreFromTray(); } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { ContextMenu menu; if (isOpen) { menu = FindResource("TrayContextMenuHide") as ContextMenu; } else { menu = FindResource("TrayContextMenuShow") as ContextMenu; } menu.IsOpen = true; } }; notify.BalloonTipClosed += (sender, e) => { var thisIcon = (System.Windows.Forms.NotifyIcon)sender; thisIcon.Visible = false; thisIcon.Dispose(); }; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); MainWindow = new PL.MainWindow(); // MainWindow.Closing += MainWindow_Closing; // PL.MainWindow.window.Closing += Window_Closing; this.icone = new System.Windows.Forms.NotifyIcon(); this.icone.DoubleClick += (s, args) => ShowMainWindow(); this.icone.Icon = StudUP.Properties.Resources.MyIcon; this.icone.Visible = true; CreateContextMenu(); }
private void CreateTryMode() { _notifyIcon = new System.Windows.Forms.NotifyIcon(); _notifyIcon.DoubleClick += (s, args) => ((MainWindow)MainWindow).ShowHideMainWindow(); _notifyIcon.Icon = WpfAppShortCut.Properties.Resources.MyIcon; _notifyIcon.Text = @"keymap - press Ctrl+Spacebar to open"; _notifyIcon.Visible = true; _notifyIcon.ContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); _notifyIcon.ContextMenuStrip.Items.Add("keymap search Ctrl+Spacebar").Click += (s, e) => ((MainWindow)MainWindow)?.ShowHideMainWindow(); _notifyIcon.ContextMenuStrip.Items.Add("exit").Click += (s, e) => ExitApplication(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GameWindow)); this.service = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.gameService = new System.Windows.Forms.NotifyIcon(this.components); this.SuspendLayout(); // // Service // this.service.AutoSize = true; this.service.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.service.Location = new System.Drawing.Point(120, 57); this.service.Name = "Service"; this.service.Size = new System.Drawing.Size(279, 32); this.service.TabIndex = 0; this.service.Text = "Web Sockets Demo"; this.service.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Verdana", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(123, 117); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(276, 25); this.label1.TabIndex = 1; this.label1.Text = "Game Service Running..."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // GameService // this.gameService.Icon = ((System.Drawing.Icon)(resources.GetObject("GameService.Icon"))); this.gameService.Text = "notifyIcon1"; this.gameService.Visible = true; this.gameService.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.GameService_MouseDoubleClick); // // GameWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Info; this.ClientSize = new System.Drawing.Size(520, 212); this.Controls.Add(this.label1); this.Controls.Add(this.service); this.Name = "GameWindow"; this.Text = "Web Sockets Demo - Game Service"; this.Load += new System.EventHandler(this.GameWindow_Load); this.Resize += new System.EventHandler(this.GameWindow_Resize); this.ResumeLayout(false); this.PerformLayout(); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { // close Spotify first if (SettingsXml.Current.CloseSpotifyWithToastify) { Process[] possibleSpotifys = Process.GetProcessesByName("Spotify"); if (possibleSpotifys.Count() > 0) { using (Process spotify = possibleSpotifys[0]) { try { // try to close spotify gracefully if (spotify.CloseMainWindow()) { spotify.WaitForExit(1000); } // didn't work (Spotify often treats window close as hide main window) :( Kill them! if (!spotify.HasExited) { Process.GetProcessesByName("Spotify")[0].Kill(); } } catch { } // ignore all process exceptions } } } // Ensure trayicon is removed on exit. (Thx Linus) trayIcon.Visible = false; trayIcon.Dispose(); trayIcon = null; // Let the plugins now we're closing up. // we do this last since it's transparent to the user foreach (var p in this.Plugins) { try { p.Closing(); p.Dispose(); } catch (Exception) { //For now we swallow any plugin errors. } } this.Plugins.Clear(); base.OnClosing(e); }
private void CreateNotifyIcon(System.Windows.Forms.ContextMenu Menu) { var _TrayIcon_ = new System.Windows.Forms.NotifyIcon() { Visible = true, ContextMenu = Menu, Text = "CopyTop", }; _TrayIcon_.Icon = new Icon(Application.GetResourceStream(new Uri("pack://application:,,,/CopyTop;component/Copy.ico")).Stream); _TrayIcon_.DoubleClick += (sender, e) => { Visibility = Visibility.Visible; }; Application.Current.Exit += (sender, e) => { _TrayIcon_.Visible = false; _TrayIcon_.Dispose(); }; }
private void CreateContextMenu(System.Windows.Forms.NotifyIcon notifyIcon) { if (notifyIcon != null) { notifyIcon.ContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); notifyIcon.ContextMenuStrip.Items.Add("Application Name", WPFSystemTray.Properties.Resources.palm_tree_icon).Click += NotifyIcon_ApplicationName_Click; notifyIcon.ContextMenuStrip.Items.Add("Exit").Click += NotifyIcon_Exit_Click; } }
public App() { _notifyIcon = new System.Windows.Forms.NotifyIcon { Icon = Resource.TimeTracker, Visible = true, ContextMenuStrip = new System.Windows.Forms.ContextMenuStrip() }; _notifyIcon.ContextMenuStrip.Items.Add("Close").Click += (s, e) => Current.Shutdown(); _loggingService = new LoggingService(); _persistenceService = new PersistenceService(); }
protected override void OnStartup(StartupEventArgs e) { App.icon = new NotifyIcon(); icon.Click += new EventHandler(icon_Click); icon.Icon = Insomnia.Properties.Resources.Owl; icon.Visible = true; base.OnStartup(e); // Prevent the system from sleeping PowerHelpers.EnableInsomnia(); }
public MainWindow() { InitializeComponent(); Server server = new Server(); server.onMessage(delegate(string message) { Application.Current.Dispatcher.Invoke(delegate { processSentence(message); }); }); server.Start(); //new Popup("Dude ! that's an error ?!", "Error").Show(); //return; // initializing process startInfo = new ProcessStartInfo(); process = new Process(); startInfo.WorkingDirectory = USER_DIR; process.StartInfo = startInfo; System.Windows.Forms.ContextMenu contextMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem menuItem = new System.Windows.Forms.MenuItem(); contextMenu.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { menuItem }); menuItem.Index = 0; menuItem.Text = "Exit"; menuItem.Click += delegate(object sender, EventArgs e) { this.Close(); }; System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon(@"..\..\Resources\oston.ico"); ni.ContextMenu = contextMenu; ni.Visible = true; ni.Click += delegate(object sender, EventArgs args) { if (this.WindowState == WindowState.Minimized) { this.Show(); this.WindowState = WindowState.Normal; animate(this, OpacityProperty, 0, 1, 200); } }; initialize(); }
private bool TryDestroyTrayIcon() { if (trayIcon != null) { trayIcon.MouseClick -= OnTrayIconClick; trayIcon.Dispose(); trayIcon = null; return(true); } return(false); }
private void icon() { this.notifyIcon = new System.Windows.Forms.NotifyIcon(); // this.notifyIcon.BalloonTipText = "单击 ~ 波浪键 呼叫我"; //设置程序启动时显示的文本 this.notifyIcon.BalloonTipText = "双击 Alt键 呼叫我"; //设置程序启动时显示的文本 this.notifyIcon.Text = "快闪启动 双击退出"; //最小化到托盘时,鼠标点击时显示的文本 this.notifyIcon.Icon = Kindle_Quick.Properties.Resources.flash; //程序图标 this.notifyIcon.Visible = true; this.notifyIcon.MouseDoubleClick += OnNotifyIconDoubleClick; this.notifyIcon.MouseClick += notifyIcon_MouseClick; this.notifyIcon.ShowBalloonTip(1000); }
/// <summary> /// Initializes the m_trayIcon member, loading the icon graphic and hooking appropriate /// handlers to respond to user iteraction requesting to bring the application back out of /// the tray. /// </summary> private void InitTrayIcon() { m_trayIcon = new System.Windows.Forms.NotifyIcon(); m_trayIcon.Icon = new System.Drawing.Icon(AppDomain.CurrentDomain.BaseDirectory + "stahpit.ico"); m_trayIcon.DoubleClick += delegate(object sender, EventArgs args) { BringAppToFocus(); }; }
public MainWindow() { InitializeComponent(); zh_ch = new Zh_Ch(); TB_Path.Text = Properties.Settings.Default.TB_Path; ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("lh2_5jL_icon.ico"); ni.DoubleClick += PopUp; Monitor(); }
public TrayIcon(TrayViewModel trayViewModel) { _trayViewModel = trayViewModel; _trayViewModel.PropertyChanged += TrayViewModel_PropertyChanged; _trayIcon = new System.Windows.Forms.NotifyIcon(); _trayIcon.MouseClick += TrayIcon_MouseClick; _trayIcon.Icon = _trayViewModel.TrayIcon; _trayIcon.Text = _trayViewModel.ToolTip; App.Current.Exit += App_Exit; }
public void makeicon() { System.Windows.Forms.NotifyIcon nin = new System.Windows.Forms.NotifyIcon(); nin.Icon = new System.Drawing.Icon("s.ico"); nin.Visible = true; nin.MouseClick += new System.Windows.Forms.MouseEventHandler(iconclick); System.Windows.Forms.ContextMenu ninMenu = new System.Windows.Forms.ContextMenu(); ninMenu.MenuItems.Add("Close App", new EventHandler(CloseApp)); nin.ContextMenu = ninMenu; }
public static void NIDoubleClick(System.Windows.Forms.NotifyIcon _NotifyIcon, MainWindow _THIS) { if (_THIS == null) { throw new ArgumentNullException(nameof(_THIS)); } _NotifyIcon.DoubleClick += delegate(object sender, EventArgs args) { ShowW_NIoff(_NotifyIcon, _THIS); }; }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.timer = new DispatcherTimer(TimeSpan.FromSeconds(1), DispatcherPriority.Normal, new EventHandler(this.FuckMicrosoft), base.Dispatcher); this.timer.Start(); this.textBox.Text += ("Start timer\n"); this.renderTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(200), DispatcherPriority.Render, new EventHandler(this.AddDanmu), base.Dispatcher); this.renderTimer.Start(); this.textBox.Text += ("Start consumer\n"); this.OpenOverlay(); this.overlay.Show(); this.textBox.Text += ("Start overlay\n"); this.OpenFullOverlay(); this.fulloverlay.Show(); this.textBox.Text += ("Start full overlay\n"); try { HttpListener listener = new HttpListener(); listener.Prefixes.Add("http://+:7773/"); listener.Start(); listener.BeginGetContext(ProcessRequest, listener); } catch (Exception ex) { MessageBox.Show(this, ex.Message); App.Current.Shutdown(); } this.textBox.Text += ("Start RPC server\n"); notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.BalloonTipText = "弹幕DA☆ZE"; notifyIcon.BalloonTipTitle = "DanmukuApp"; notifyIcon.Text = "DanmukuApp Tray"; notifyIcon.Icon = System.Drawing.SystemIcons.WinLogo; notifyIcon.Visible = true; notifyIcon.ShowBalloonTip(800); notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick); notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[] { new System.Windows.Forms.MenuItem("关于", (obj, args) => System.Windows.MessageBox.Show(this, "DanmukuApp by bajdcc", "NewsApp")), new System.Windows.Forms.MenuItem("-"), new System.Windows.Forms.MenuItem("显示全屏弹幕", (obj, args) => DanmukuService.danmu = true), new System.Windows.Forms.MenuItem("关闭全屏弹幕", (obj, args) => DanmukuService.danmu = false), new System.Windows.Forms.MenuItem("-"), new System.Windows.Forms.MenuItem("关闭", (obj, args) => Close()), }); DelayHide(); }
private void InitialTray() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.BalloonTipText = "我在这里"; notifyIcon.Text = "CozyLauncher"; notifyIcon.Icon = CozyLauncher.Resource.AppTray; notifyIcon.Visible = true; notifyIcon.Click += NotifyIcon_Click; InitialTrayMenu(); }
public MainWindow() { InitializeComponent(); try { if (!File.Exists(LOG_PATH)) { throw new FileNotFoundException(); } XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection <ApplicationLog>)); using (TextReader writer = new StreamReader(LOG_PATH)) { ApplicationLogList = (ObservableCollection <ApplicationLog>)serializer.Deserialize(writer); } } catch { ApplicationLogList = new ObservableCollection <ApplicationLog>(); } ApplicationsTreeView.ItemsSource = ApplicationLogList; timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); DispatcherTimer timer2 = new DispatcherTimer(); timer2.Interval = TimeSpan.FromSeconds(10); timer2.Tick += timer_Tick2; timer2.Start(); StopTimerMenu.IsEnabled = true; StartTimerMenu.IsEnabled = false; #region NotifyIcon var ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("icon.ico"); ni.Visible = true; ni.DoubleClick += delegate { Show(); WindowState = WindowState.Normal; }; #endregion }
public MainWindow() { InitializeComponent(); appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Tlhan Ghun\\Paw\\"; appProgramPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase); try { if (Properties.Settings.Default.useAutomaticUpdate) { Winkle.VersionCheck myUpdateChecker = new Winkle.VersionCheck("Paw", "http://tlhan-ghun.de/files/pawWinkle.xml"); Winkle.UpdateInfo myUpdateResponse = myUpdateChecker.checkForUpdate(System.Reflection.Assembly.GetExecutingAssembly(), true); Console.WriteLine("Update check done"); } } catch { } passwordManager = new PasswordManager(); registeredApps = new Dictionary <string, GrowlApplication>(); pawIconPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\Paw.ico"; if (!System.IO.Directory.Exists(appDataPath)) { System.IO.Directory.CreateDirectory(appDataPath); } Growl.Connector.Application pawApp = new Growl.Connector.Application("Paw"); List <NotificationType> pawClasses = new List <NotificationType>(); pawClasses.Add(new NotificationType("General notifications")); pawClasses.Add(new NotificationType("Growl server messages")); pawClasses.Add(new NotificationType("Error messages")); pawApp.Icon = Growl.CoreLibrary.ImageConverter.ImageFromUrl(appProgramPath + "\\Paw.ico"); GrowlApplication comWindow = new GrowlApplication(pawApp, pawClasses); registeredApps.Add("Paw", comWindow); m_notifyIcon = new System.Windows.Forms.NotifyIcon(); m_notifyIcon.Text = "Paw - a GNTP to Snarl bridge"; m_notifyIcon.Icon = new System.Drawing.Icon(pawIconPath); m_notifyIcon.Click += new EventHandler(trayClick); m_notifyMenu = new System.Windows.Forms.ContextMenu(); m_notifyMenu.MenuItems.Add("Paw"); m_notifyMenu.MenuItems.Add("-"); m_notifyMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Start / stop", new System.EventHandler(trayStartStop))); m_notifyMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Preferences", new System.EventHandler(trayClick))); m_notifyMenu.MenuItems.Add("-"); m_notifyMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Quit", new System.EventHandler(trayClose))); m_notifyIcon.ContextMenu = m_notifyMenu; }
public MainWindow() { InitializeComponent(); notifyIcon = new System.Windows.Forms.NotifyIcon(); using (Stream s = Application.GetResourceStream(new Uri("alarm.ico", UriKind.Relative)).Stream) notifyIcon.Icon = new System.Drawing.Icon(s); notifyIcon.Text = "알람"; notifyIcon.MouseDown += NotifyIcon_MouseDown; notifyIcon.DoubleClick += NotifyIcon_DoubleClick; notifyIcon.BalloonTipClicked += NotifyIcon_DoubleClick; notifyIcon.Visible = true; // timer for calculating current time. DispatcherTimer timer = new DispatcherTimer(); timer.Tick += Timer_Tick; timer.Interval = TimeSpan.FromMilliseconds(1000); timer.Start(); // load alarm sound StreamResourceInfo sri = Application.GetResourceStream(new Uri("/Resources/alarm.wav", UriKind.Relative)); if (sri != null) { using (Stream s = sri.Stream) { alarmSound = new SoundPlayer(s); alarmSound.Load(); } } patterns = new AlarmPatternDictionary(); patterns.LoadFromSettings(); btsButtons.Buttons = patterns.Patterns; btsButtons.SelectedIndex = App.Settings.Get("SelectedPatternIndex", 1); itemsAlarm.ItemsSource = Alarms.Collection; for (int i = 1; i <= 12; i++) { cbxAlarmHour.Items.Add(i); } for (int i = 1; i < 60; i++) { cbxAlarmMinute.Items.Add(i < 10 ? ("0" + i) : i.ToString()); } // Initial setting to show current time at first. Timer_Tick(null, null); }
public MainWindow() { InitializeComponent(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("Main.ico"); ni.Visible = true; ni.DoubleClick += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; }
public MainWindow() { InitializeComponent(); notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Icon = new System.Drawing.Icon(@"..\..\Image\tray_ico.ico"); notifyIcon.Visible = true; notifyIcon.DoubleClick += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; }
private void _configureTaskBarAndSystemTray() { System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); // require a System.Drawing reference ... // TODO :: replace it without the reference ni.Icon = _loadTrayIcon(); ni.Visible = true; ni.DoubleClick += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; }