internal static void CheckRegistryUpdate(int version, NotifyIcon notifyIcon) { notifyIcon.ShowBalloonTip(0, "Locale Emulator V" + Application.ProductVersion, "Checking for registry updates ...", ToolTipIcon.Info); string url = string.Format(@"http://service.watashi.me/le/registry.php?ver={0}&lang={1}", version, CultureInfo.CurrentUICulture.LCID); try { var webFileUri = new Uri(url); WebRequest webRequest = WebRequest.Create(webFileUri); webRequest.Timeout = 10 * 1000; WebResponse response = webRequest.GetResponse(); var xmlContent = new XmlDocument(); xmlContent.Load(response.GetResponseStream()); ProcessUpdate(xmlContent, notifyIcon); } catch (Exception ex) { notifyIcon.ShowBalloonTip(0, "Locale Emulator V" + Application.ProductVersion, "Error occurs when downloading new registry data: \r\n" + ex.Message, ToolTipIcon.Error); Thread.Sleep(5000); notifyIcon.Visible = false; Environment.Exit(0); } }
public static void Main (string[] args) { Thread notifyThread = new Thread( delegate() { ShowWindow(GetConsoleWindow(), 0); ContextMenu menu = new ContextMenu(); MenuItem mnuExit = new MenuItem("Выход"); menu.MenuItems.Add(0, mnuExit); icon = new NotifyIcon() { Icon = SlideSwitcherServer.Resources.logo, ContextMenu = menu, Text = "Slide Switcher Server", }; mnuExit.Click += delegate { icon.Dispose(); Application.Exit(); }; icon.Visible = true; icon.ShowBalloonTip(4000, "Slide Switcher", "Server", ToolTipIcon.Info); Application.Run(); } ); notifyThread.Start(); Server(port); }
//get the current account balance for a given user public string getAccountBalance(string username, string apiKey, ref NotifyIcon notifyIcon) { string accountBalance = "0.0"; try { if (String.IsNullOrEmpty(username)) return ""; WebClient client = new WebClient(); string urlFormat = "http://marketplace.envato.com/api/v1/" + username + "/" + apiKey + "/account.json"; Uri url = new Uri(string.Format(urlFormat)); string data = client.DownloadString(url); using (JsonReader reader = new JsonReader(new StringReader(data))) { while (reader.Read()) { //users++; if ((string)reader.Value == "balance") { reader.Read(); accountBalance = (string)reader.Value; } } reader.Close(); //close the reader object } } catch (WebException webex) { notifyIcon.ShowBalloonTip(180000000, "EnvatoTracker error!", "Error querying the api - invalid api key maybe?\n\nError:"+webex, ToolTipIcon.None); } return accountBalance; }
private void btnLogin_Click(object sender, EventArgs e) { string response = network.HttpPost("http://www.status3gaming.com/gmtool/", "user="******"&pass="******"0"){ MessageBox.Show("Failed Login", "Response", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (Regex.IsMatch(response, "[0-9A-Fa-f]{40}")) { Program.SetHash(response); MessageBox.Show("Successfully Logged In", "Response", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.Visible = false; //Create Context Menu for system tray. sysTrayMenu = new ContextMenu(); sysTrayMenu.MenuItems.Add("Check for new tickets...", OnRefresh); sysTrayMenu.MenuItems.Add("Quit", OnExit); sysTrayIcon = new NotifyIcon(); sysTrayIcon.Text = "GM Tool"; sysTrayIcon.Icon = Properties.Resources.Tray; // Add menu to tray icon and show it. sysTrayIcon.ContextMenu = sysTrayMenu; sysTrayIcon.Visible = true; sysTrayIcon.BalloonTipClicked += new EventHandler(sysTrayIcon_BaloonTipClicked); sysTrayIcon.ShowBalloonTip(5000, "GM Tool", "Tray Monitor Active", ToolTipIcon.None); timer.Start(); } }
public Form1() { InitializeComponent(); this.Text = ""; this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Width = Properties.Resources.USB.Width; this.Height = Properties.Resources.USB.Height; this.BackgroundImage = Properties.Resources.USB; this.TopMost = true; this.ShowInTaskbar = false; m_Icon = new NotifyIcon(); m_Icon.Icon = Properties.Resources.USB_Icon; MenuItem[] items = new MenuItem[2]; items[1] = new MenuItem("Exit"); items[1].Click += new EventHandler(Exit); items[0] = new MenuItem("About"); items[0].Click += new EventHandler(About); m_Icon.ContextMenu = new ContextMenu(items); m_Icon.Visible = true; m_Icon.BalloonTipIcon = ToolTipIcon.Info; m_Icon.BalloonTipText = "USB Watcher Watching"; m_Icon.ShowBalloonTip(2000); m_Icon.Text = "USB Watcher"; SetWindowLong(this.Handle, -20, 0x80000 | 0x20); SetLayeredWindowAttributes(this.Handle, 0, 175, 0x2); }
public SysTrayHandler() { InitializeComponent(); this.dh = new DataHandler(); this.TransparencyKey = Color.Turquoise; this.BackColor = Color.Turquoise; trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Quit Tristram App", onExit); Icon theIcon = new Icon( System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Tristram_Status.Resources.tristram_icon.ico") ); trayIcon = new NotifyIcon(); trayIcon.Text = "Tristram Status"; trayIcon.Icon = theIcon; trayIcon.ContextMenu = trayMenu; trayIcon.Visible = true; trayIcon.ShowBalloonTip(5000, "Tristram status", "Application is now running", ToolTipIcon.Info); Visible = true; int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width; int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height; this.SetDesktopLocation(x, y); // Animation timer this.animator = new Timer(); this.animator.Interval = 20; this.animator.Tick += animate; }
static void ShowNotification(string text, string title) { var container = new Container(); var wait = new ManualResetEvent(false); var trayicon = new NotifyIcon(container); EventHandler done = null; done = delegate { wait.Set(); trayicon.BalloonTipClosed -= done; trayicon.BalloonTipClicked -= done; }; trayicon.BalloonTipClicked += done; trayicon.BalloonTipClosed += done; trayicon.BalloonTipTitle = title; trayicon.BalloonTipText = text; var exe = Environment.GetFolderPath( Environment.SpecialFolder.ProgramFilesX86) + @"\iTunes\iTunes.exe"; var icon = Icon.ExtractAssociatedIcon(exe); trayicon.Icon = new Icon(icon, 16, 16); trayicon.Visible = true; trayicon.ShowBalloonTip(5000); wait.WaitOne(10000); trayicon.Visible = false; trayicon.Dispose(); icon.Dispose(); container.Dispose(); }
public MainWindow() { InitializeComponent(); this.Visibility = Visibility.Hidden; notifyicon = new NotifyIcon(); notifyicon.BalloonTipTitle = "ECG Collector"; notifyicon.BalloonTipText = "ECG Collector is now running ..."; notifyicon.Icon = new System.Drawing.Icon("logo.ico"); notifyicon.Visible = true; notifyicon.ShowBalloonTip(2000); MenuItem about = new MenuItem("About"); about.Click += new EventHandler(About_OnClick); MenuItem exit = new MenuItem("Exit"); exit.Click += new EventHandler(Exit_OnClick); MenuItem[] children = new MenuItem[] { about, exit }; notifyicon.ContextMenu = new ContextMenu(children); serialportThread = new Thread(new ThreadStart(CheckSerialport)); serialportThread.Start(); connectThread = new Thread(new ThreadStart(BeginConnect)); connectThread.Start(); }
protected override bool OnStartup(StartupEventArgs e) { //XmlConfigurator.Configure(); _touchMouseEventManager.Init(); _icon = new NotifyIcon { Icon = Properties.Resources.mouse, Visible = true }; var contextMenuStrip = new ContextMenuStrip(); contextMenuStrip.Items.Add(new MiddleClickStripMenuItem(_touchConfiguration)); contextMenuStrip.Items.Add(new TouchOverStripMenuItem(_touchConfiguration)); contextMenuStrip.Items.Add(new LeftHandedStripMenuItem(_touchConfiguration)); contextMenuStrip.Items.Add(new HelpToolStripMenuItem()); contextMenuStrip.Items.Add(new ToolStripSeparator()); contextMenuStrip.Items.Add(new MouseMapStripMenuItem(_touchMouseEventManager)); contextMenuStrip.Items.Add(new TouchZoneConfigurationStripMenuItem(_touchMouseEventManager, _touchZoneProvider)); contextMenuStrip.Items.Add(new ToolStripSeparator()); contextMenuStrip.Items.Add(new ExitStripMenuItem(_icon)); //Published on November 23rd 2008 by Aston. //Released under the Free Art (copyleft) license. // Icon for Windows XP, Vista and 7. _icon.ContextMenuStrip = contextMenuStrip; _icon.ShowBalloonTip(5000, "Info", "Touch Mouse Mate has started", ToolTipIcon.Info); _icon.Text = string.Format("Touch Mouse Mate {0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); Application.Run(); return false; }
public static void ShowNotifyTip(NotifyIcon notifyIcon, String NotifyTitle, String Message, ToolTipIcon TipIcon) { if (String.IsNullOrEmpty(Message)) { Message = " "; } notifyIcon.ShowBalloonTip(300, NotifyTitle, Message, TipIcon); }
static void Main() { NotifyIcon icon = new NotifyIcon(); icon.Icon = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().Location); icon.Visible = true; if (Properties.Settings.Default.dirPath == "" || Properties.Settings.Default.password == "" || Properties.Settings.Default.driveLetter == "") { icon.ShowBalloonTip( 1000, "Unable to open encrypted file", "Please open this program normally and fill in the required information", ToolTipIcon.Error ); return; } if (System.IO.Directory.Exists(Properties.Settings.Default.driveLetter)) { if (Setup.Mount()) { icon.ShowBalloonTip( 1000, "Successful!", "You encrypted volume is now mounted", ToolTipIcon.None); } else { icon.ShowBalloonTip( 1000, "Failure", "Your encrypted volume was unable to be mounted", ToolTipIcon.Error); } } else { if (Setup.UnMount()) { icon.ShowBalloonTip( 1000, "Successful!", "You encrypted volume is now unmounted", ToolTipIcon.None); } else { icon.ShowBalloonTip( 1000, "Failure", "Your encrypted volume was unable to be unmounted", ToolTipIcon.Error); } } }
public void showViaSystemTrayBalloon(String track, String artist) { NotifyIcon balloon = new NotifyIcon(); balloon.Icon = SystemIcons.Exclamation; balloon.BalloonTipIcon = ToolTipIcon.Info; balloon.BalloonTipTitle = "Spotify Song Changed"; balloon.BalloonTipText = getNotificationText(track, artist); balloon.Visible = true; balloon.ShowBalloonTip(3000); }
public void Balloon () { NotifyIcon ni = new NotifyIcon (); ni.Text = "NotifyIcon Text"; ni.BalloonTipTitle = "Balloon Tip Title"; ni.BalloonTipText = "Balloon Tip Text."; ni.BalloonTipIcon = ToolTipIcon.None; ni.Visible = true; ni.ShowBalloonTip (1); }
public static void Show(TrayNotifierInfo trayNotifierInfo) { if ((trayNotifierInfo != null) && (trayNotifierInfo.TimeOut >= 0)) { if (notifyIcon != null) { notifyIcon.Dispose(); } NotifyIcon tempLocal0 = new NotifyIcon { Text = trayNotifierInfo.Text, Icon = trayNotifierInfo.Icon, BalloonTipIcon = trayNotifierInfo.TipIcon, BalloonTipText = trayNotifierInfo.TipText, BalloonTipTitle = trayNotifierInfo.TipTitle, ContextMenuStrip = CreateContextMenu(trayNotifierInfo.MenuItems) }; notifyIcon = tempLocal0; EventHandler showFormClick = delegate { if (trayNotifierInfo.Source != null) { MainForm.ShowInstance(trayNotifierInfo.Source); } else { MainForm.ShowInstance(); } notifyIcon.Dispose(); }; notifyIcon.BalloonTipClicked += showFormClick; notifyIcon.DoubleClick += showFormClick; notifyIcon.Click += showFormClick; notifyIcon.Visible = true; if (trayNotifierInfo.ShowBalloonTip) { notifyIcon.ShowBalloonTip(trayNotifierInfo.TimeOut * 0x3e8); } if (trayNotifierInfo.TimeOut > 0) { Timer tempLocal1 = new Timer { Interval = trayNotifierInfo.TimeOut * 0x3e8 }; timer = tempLocal1; timer.Tick += delegate { notifyIcon.Dispose(); timer.Stop(); }; timer.Start(); } } }
public AppContext() { trayIcon = new NotifyIcon() { Icon = Properties.Resources.ycicon, ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("Show", Show), new MenuItem("Exit", Exit) }), Visible = true }; trayIcon.ShowBalloonTip(2000, "YCNotify", "YCNotify is running in your system tray", ToolTipIcon.Info); }
private void Notify() { //设置托盘的各个属性 _notifyIcon = new NotifyIcon { BalloonTipText = Properties.Resources.notify_text, Text = Properties.Resources.notify_text, Icon = new System.Drawing.Icon(AppDomain.CurrentDomain.BaseDirectory + "//notify.ico"), Visible = true }; _notifyIcon.ShowBalloonTip(1000); _notifyIcon.MouseClick += notifyIcon_MouseClick; _notifyIcon.DoubleClick += notifyIcon_DoubleClick; _notifyIcon.MouseMove += notifyIcon_MouseMove; ////设置菜单项 MenuItem setting = new MenuItem("设置"); setting.Click += new EventHandler(setting_Click); //帮助选项 MenuItem help = new MenuItem("帮助"); help.Click += new EventHandler(help_Click); //关于选项 MenuItem about = new MenuItem("关于"); about.Click += new EventHandler(about_Click); //退出菜单项 MenuItem exit = new MenuItem("退出"); exit.Click += new EventHandler(exit_Click); //关联托盘控件 MenuItem[] childen = new MenuItem[] { about, exit }; _notifyIcon.ContextMenu = new ContextMenu(childen); //窗体状态改变时候触发 this.StateChanged += new EventHandler(SysTray_StateChanged); //闪烁图标 _icoTimer.Interval = TimeSpan.FromSeconds(0.3); _icoTimer.Tick += new EventHandler(IcoTimer_Tick); Subscription.OnNotify(ReceiveNewMsg); Subscription.OnClear(ClearNotifyCallback); ////var taskbarinfo = new TaskbarItemInfo(); //////0 ~ 1.0 是进度值 ////taskbarinfo.ProgressValue = 1.0; ////taskbarinfo.ProgressState = TaskbarItemProgressState.Error; //////通过Window类型的TaskbarItemInfo属性设置TaskbarItemInfo对象 ////this.TaskbarItemInfo = taskbarinfo; }
private void Click(object sender, RoutedEventArgs e) { // Configure and show a notification icon in the system tray _notifyIcon = new NotifyIcon { BalloonTipText = @"Hello, NotifyIcon!", Text = @"Hello, NotifyIcon!", Icon = new Icon("NotifyIcon.ico"), Visible = true }; _notifyIcon.ShowBalloonTip(1000); }
private void showNotifyicon() { /*Show notify icon*/ myNotifyIcon = new NotifyIcon(); myNotifyIcon.BalloonTipText = "Client still working..."; myNotifyIcon.BalloonTipTitle = "Client grid computing"; myNotifyIcon.BalloonTipIcon = ToolTipIcon.Info; myNotifyIcon.DoubleClick += new EventHandler(myNotifyIcon_DoubleClick); string iconPath = string.Format("{0}\\CloudApp-Icon-32x32.ico", Environment.CurrentDirectory); myNotifyIcon.Icon = Properties.Resources.CloudApp_Icon_32x32; myNotifyIcon.Visible = true; myNotifyIcon.ShowBalloonTip(1000); }
//private ViewHostDialog activitiesDialog; //private ViewHostDialog usersDialog; //private ViewHostDialog editWorkDialog; public CustomApplicationContext() { CreateToolStripItems(); components = new System.ComponentModel.Container(); notifyIcon = new NotifyIcon(components) { ContextMenuStrip = new ContextMenuStrip(), Icon = Properties.Resources.ClockProcessing, Text = "Work Track", Visible = true }; var connectionInfo = SettingsToConnectionInfo(Properties.Settings.Default); if (!string.IsNullOrEmpty(connectionInfo.ServerName)) { var failMessage = InitializeConnection(connectionInfo); if (failMessage != null) { notifyIcon.Icon = Properties.Resources.ClockDisconnected; string msg = "There was an error connecting to the WorkTrack database. " + failMessage; notifyIcon.ShowBalloonTip(balloonTimeoutMs, "WorkTrack", msg, ToolTipIcon.Error); } else { notifyIcon.Icon = Properties.Resources.Clock; } } else { notifyIcon.Icon = Properties.Resources.ClockDisconnected; string msg = "Database connection has not been defined."; notifyIcon.ShowBalloonTip(balloonTimeoutMs, "WorkTrack", msg, ToolTipIcon.Warning); } notifyIcon.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening); //notifyIcon.DoubleClick += notifyIcon_DoubleClick; }
internal static void RegisterHotKey(NotifyIcon notifyIcon) { if (hotModifiers.HasFlag(Keys.Delete) || hotKey.HasFlag(Keys.Delete)) { hotModifiers = Keys.None; hotKey = Keys.None; Settings.Default.ModifierKeys = hotModifiers; Settings.Default.Key = hotKey; Settings.Default.Save(); notifyIcon.ShowBalloonTip(0, "Hot keys removed", "Hot keys have been successfully removed.", ToolTipIcon.Info); return; } HotModifierKeys modkeys = 0; if (hotModifiers.HasFlag(Keys.Control)) modkeys |= HotModifierKeys.Control; if (hotModifiers.HasFlag(Keys.Alt)) modkeys |= HotModifierKeys.Alt; if (hotModifiers.HasFlag(Keys.Shift)) modkeys |= HotModifierKeys.Shift; if (modkeys == 0 || hotKey == 0) return; if (RegisterHotKey(handle, HotKeyID, (uint)modkeys, (uint)hotKey)) { Settings.Default.ModifierKeys = hotModifiers; Settings.Default.Key = hotKey; Settings.Default.Save(); var modKeyStr = hotModifiers.ToString() == "0" ? "" : hotModifiers + " + "; notifyIcon.ShowBalloonTip(0, "AudioSwitch", string.Format( "Hot key {0}{1} has been successfully set.", modKeyStr, hotKey), ToolTipIcon.Info); } else notifyIcon.ShowBalloonTip(0, "Hot key registration failed!", "This combination might be already in use. Please try again with a different combination.", ToolTipIcon.Error); }
public MainWindow() { InitializeComponent(); var refreshTimer = new DispatcherTimer(TimeSpan.FromSeconds(1 / Settings.RefreshRate), DispatcherPriority.Render, Refresh, Dispatcher); Settings.ShowOriginalCursorData.DataChanged += Update; Settings.RefreshRateData.DataChanged += (sender, e) => refreshTimer.Interval = TimeSpan.FromSeconds(1 / Settings.RefreshRate); GC.KeepAlive(refreshTimer); NotifyIcon = new NotifyIcon { Icon = CurrentApp.DrawingIcon, Text = CurrentApp.Title, Visible = true }; NotifyIcon.MouseClick += NotifyIconClicked; NotifyIcon.ShowBalloonTip(10000, CurrentApp.Title, "Welcome! Left click here to configure your cursor, right click to quit.", ToolTipIcon.Info); }
private static void ProcessUpdate(XmlDocument xmlContent, NotifyIcon notifyIcon) { var newVer = xmlContent.SelectSingleNode(@"/VersionInfo/Version/text()").Value; if (CompareVersion(GlobalHelper.GetLEVersion(), newVer)) { try { GlobalHelper.SetLastUpdate(Int32.Parse(DateTime.Now.ToString("yyyyMMdd"))); var version = xmlContent.SelectSingleNode(@"/VersionInfo/Version/text()").Value; var date = xmlContent.SelectSingleNode(@"/VersionInfo/Date/text()").Value; url = xmlContent.SelectSingleNode(@"/VersionInfo/Url/text()").Value; var note = xmlContent.SelectSingleNode(@"/VersionInfo/Note/text()").Value; notifyIcon.BalloonTipClicked += (sender, e) => { Process.Start(url); notifyIcon.Visible = false; Environment.Exit(0); }; notifyIcon.BalloonTipClosed += (sender, e) => { notifyIcon.Visible = false; Environment.Exit(0); }; notifyIcon.ShowBalloonTip(0, String.Format("New Version {0} Available (Current: {1})", version, GlobalHelper.GetLEVersion()), String.Format("{0}\r\n" + "\r\n" + "Click here to open download page.", note), ToolTipIcon.Info); } catch (Exception) { notifyIcon.Visible = false; Environment.Exit(0); } } else { notifyIcon.Visible = false; Environment.Exit(0); } }
public UplayStarterForm() { InitializeComponent(); MinimumSize = MaximumSize = Size; FormBorderStyle = FormBorderStyle.Fixed3D; _trayMenu = new ContextMenu(); _toggleItem = new MenuItem("Enabled", (o, e) => checkBox1.Checked = !checkBox1.Checked); _toggleItem.Checked = checkBox1.Checked; _trayMenu.MenuItems.Add(_toggleItem); _trayMenu.MenuItems.Add(new MenuItem("Exit", (o, e) => Close())); _defaultBackColor = BackColor; UpdateAero(); _trayIcon = new NotifyIcon(); _trayIcon.Text = "Uplay Starter"; _trayIcon.ContextMenu = _trayMenu; _trayIcon.Icon = Icon; _trayIcon.Visible = false; Closing += (o, e) => { if (_trayIcon.Visible) { _trayIcon.Visible = false; Application.Exit(); return; } _trayIcon.Visible = true; _trayIcon.ShowBalloonTip(3000, "Uplay Starter Running!", "Uplay Starter will run in the background until closed.", ToolTipIcon.Info); Visible = ShowInTaskbar = false; e.Cancel = true; }; _trayIcon.MouseDoubleClick += (o, e) => { _trayIcon.Visible = false; Visible = ShowInTaskbar = true; }; VisibleChanged += (o, e) => UpdateAero(); _timer.Interval = 500; _timer.Tick += (o, e) => processTick(); checkBox1.Checked = true; }
public eAudioStartup() { eAudioSettingsDelegate eAudioDelegate = new eAudioSettingsDelegate(checkeAudioSettings); IAsyncResult result = eAudioDelegate.BeginInvoke(new AsyncCallback(ResultsReturned), eAudioDelegate); Assembly a = Assembly.GetExecutingAssembly(); System.IO.Stream eAudioIcon = a.GetManifestResourceStream("eAudioStartup.eAudio.ico"); tray = new NotifyIcon(); tray.Icon = new Icon(eAudioIcon); tray.Visible = true; tray.ShowBalloonTip(500, "eAudioStartup Manager", "Waiting for eAudio...", ToolTipIcon.Info); tray.Click += new EventHandler(delegate { tray.ShowBalloonTip(1000, "eAudioStartup Manager", "eAudioManager running...", ToolTipIcon.Info); }); //Thread.Sleep(20000); }
static void Main(string[] args) { var title = "please supply a title and message"; var message = "these should be the first two arguments on the command line"; if (args.Length > 0) title = message = args[0]; if (args.Length > 1) message = args[1]; var assembly = Assembly.GetExecutingAssembly(); using (var stream = assembly.GetManifestResourceStream(assembly.GetManifestResourceNames().First())) using (var notifyIcon = new NotifyIcon()) { notifyIcon.Icon = new System.Drawing.Icon(stream); notifyIcon.Visible = true; notifyIcon.ShowBalloonTip(5000, title, message, ToolTipIcon.Info); } }
public void Show(string title, string message) { if (string.IsNullOrEmpty(message)) return; var notifyIcon = new NotifyIcon { Icon = new Icon(SystemIcons.Application, 40, 40), Visible = true, BalloonTipText = message, BalloonTipIcon = ToolTipIcon.Info, BalloonTipTitle = title }; notifyIcon.ShowBalloonTip(500); }
DesktopSnapper fSnapper; // The object that managers the snapshots public DDHostTrayApp() { // Create a simple tray menu with only one item. trayMenu = new ContextMenu(); menu_Settings=new MenuItem("Settings", OnSettingsSelect); menu_Sharing = new MenuItem("Sharing", OnChangeSharing); menu_RemoteControl = new MenuItem("Remote Control", OnRemoteControl); menu_Gray = new MenuItem("Gray", OnChangeGray); menu_Exit = new MenuItem("Exit", OnExit); trayMenu.MenuItems.Add(menu_Settings); trayMenu.MenuItems.Add(menu_RemoteControl); trayMenu.MenuItems.Add(menu_Sharing); trayMenu.MenuItems.Add(menu_Gray); trayMenu.MenuItems.Add(new MenuItem("-")); trayMenu.MenuItems.Add(menu_Exit); // Create a tray icon. In this example we use a // standard system icon for simplicity, but you // can of course use your own custom icon too. trayIcon = new NotifyIcon(); trayIcon.Text = "DD Host"; trayIcon.Icon = new Icon("computer.ico"); // Add menu to tray icon and show it. trayIcon.ContextMenu = trayMenu; trayIcon.Visible = true; trayIcon.MouseDown += new System.Windows.Forms.MouseEventHandler(DDHostTrayApp_MouseDown); trayIcon.ShowBalloonTip(0, "DD Host", "Right Click for Settings", ToolTipIcon.Info); trayIcon.BalloonTipShown += new EventHandler(trayIcon_BalloonTipShown); // Create the communications sessions fGroupEndPoint = new IPEndPoint(IPAddress.Parse("234.5.7.15"), 5004); fSession = new MultiSession(Guid.NewGuid().ToString(), fGroupEndPoint); fGraphicsChannel = fSession.CreateChannel(PayloadType.dynamicPresentation); fUserIOChannel = fSession.CreateChannel(PayloadType.xApplication2); fSnapper = new DesktopSnapper(fGraphicsChannel, fUserIOChannel, true); menu_Gray.Checked = fSnapper.SendLuminance; menu_RemoteControl.Checked = fSnapper.AllowRemoteControl; menu_Sharing.Checked = fSnapper.ActivelySharing; }
static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Usage: KeikoTray.exe keikoName"); Environment.Exit(1); } var name = args[0]; var contextMenu1 = new ContextMenu(); var menuItem1 = new MenuItem(); var notifyIcon1 = new NotifyIcon(); contextMenu1.MenuItems.AddRange(new[] { menuItem1 }); menuItem1.Index = 0; menuItem1.Text = "E&xit"; menuItem1.Click += (object s, EventArgs e) => { notifyIcon1.Visible = false; Application.Exit(); }; notifyIcon1.ContextMenu = contextMenu1; notifyIcon1.Text = String.Format("[{0}]", name); notifyIcon1.Visible = true; var keiko = new Keiko("http://virtualkeiko.herokuapp.com/", name); var anim = new KeikoAnimation(icon => notifyIcon1.Icon = icon); Observable.Interval(TimeSpan.FromSeconds(3.0)) .Select(_ => keiko.GetState()) .DistinctUntilChanged() .Subscribe(state => { if (state.StartsWith("220")) { notifyIcon1.ShowBalloonTip(1000, name, "Error", ToolTipIcon.Error); } anim.SetState(state); }); Application.Run(); }
private void button2_Click(object sender, EventArgs e) { //任务栏不显示 this.ShowInTaskbar = false; //托盘图标 this.components = new System.ComponentModel.Container(); NotifyIcon icon = new NotifyIcon(components); icon.Icon = WindowsFormsApplication1.Properties.Resources.IconCapture; icon.Text = "notifyIcon1"; icon.Visible = true; //气泡提示 icon.BalloonTipIcon = ToolTipIcon.Info; icon.BalloonTipText = "内容"; icon.BalloonTipTitle = "title"; icon.ShowBalloonTip(3000); }
private void InicializeIconeMenu() { notifyIcon = new NotifyIcon(); notifyIcon.BalloonTipText = "aTurTes"; notifyIcon.Icon = new Icon(GetType(), "icone.ico"); notifyIcon.Visible = true; notifyIcon.ShowBalloonTip(500); m_menu = new System.Windows.Forms.ContextMenu(); m_menu.MenuItems.Add(0, new System.Windows.Forms.MenuItem("Agenda", new System.EventHandler(tsmiAgenda_Click))); m_menu.MenuItems.Add(1, new System.Windows.Forms.MenuItem("Leitor Twiter", new System.EventHandler(tsmiTwiter_Click))); m_menu.MenuItems.Add(2, new System.Windows.Forms.MenuItem("Ler Arquivo", new System.EventHandler(tsmiArquivo_Click))); m_menu.MenuItems.Add(3, new System.Windows.Forms.MenuItem("Ler Texto", new System.EventHandler(tsmiLerTexto_Click))); m_menu.MenuItems.Add(4, new System.Windows.Forms.MenuItem("Sobre", new System.EventHandler(tsmiSobre_Click))); m_menu.MenuItems.Add(5, new System.Windows.Forms.MenuItem("Sair", new System.EventHandler(tsmiSair_Click))); notifyIcon.ContextMenu = m_menu; }
private void Callback_StateChange(object sender, StatusChangeEventArgs e) { _notifyIcon.ShowBalloonTip(2000, "Plex Service", e.Description, ToolTipIcon.Info); }
public void ShowAlert(string message, TimeSpan timeSpan) { _notifyIcon.ShowBalloonTip(Convert.ToInt32(timeSpan.TotalMilliseconds), "", message, System.Windows.Forms.ToolTipIcon.None); }