private async void TryRegisterForStartup() { try { #if SQUIRREL var startupManager = new StartupManager("Roamit Cloud Clipboard"); startupManager.AddApplicationToCurrentUserStartup(); #else var startupTask = await Windows.ApplicationModel.StartupTask.GetAsync("RoamitStartupTask"); if (startupTask.State != Windows.ApplicationModel.StartupTaskState.Enabled) { var state = await startupTask.RequestEnableAsync(); if (state == Windows.ApplicationModel.StartupTaskState.DisabledByUser) { notifyIcon?.ShowBalloonTip(int.MaxValue, "Roamit is not allowed to run on startup", "For best universal clipboard experience, please allow Roamit to run on startup from Task Manager", ToolTipIcon.Warning); } } #endif } catch (Exception ex) { Debug.WriteLine("Failed to register program to run at startup."); #if !SQUIRREL notifyIcon?.ShowBalloonTip(int.MaxValue, "Failed to register Roamit to run on startup", ex.Message, ToolTipIcon.Warning); #endif } }
private void MinizeIcon() { WindowState = WindowState.Minimized; Hide(); _notifyIcon.Visible = !IsVisible; _notifyIcon?.ShowBalloonTip(2000); }
public static void ShowNotification(int timeout, string title, string message, string typeIcon) { switch (typeIcon) { case "None": _notifyIcon?.ShowBalloonTip(timeout, title, message, ToolTipIcon.None); break; case "Info": _notifyIcon?.ShowBalloonTip(timeout, title, message, ToolTipIcon.Info); break; case "Error": _notifyIcon?.ShowBalloonTip(timeout, title, message, ToolTipIcon.Error); break; case "Warning": _notifyIcon?.ShowBalloonTip(timeout, title, message, ToolTipIcon.Warning); break; } }
public override void Show(string title, string detail, string sound = null) { notifyIcon?.ShowBalloonTip(1000, title, detail, ToolTipIcon.None); if (!string.IsNullOrEmpty(sound)) { DispatcherHelper.UIDispatcher.Invoke(() => { try { player.Open(new Uri(sound, UriKind.Relative)); player.Play(); } catch { } }); } }
private void OnStateChanged() { if (WindowState == WindowState.Minimized) { // notify to hide the application _trayIconService.HideApp(); // show the tray icon ShowTrayIcon(true); // notify user that the application is in the tray if (_notifyIconInfo.ShowBaloonTip) { _notifyIcon?.ShowBalloonTip(2000); } } else { _storedWindowState = WindowState; } }
public void pop(string state, int dur = 1000) { m_tray.BalloonTipText = states[state].text; m_tray.BalloonTipIcon = states[state].icon; m_tray.ShowBalloonTip(dur); }
private void TrayIcon_DoubleClick(object sender, EventArgs e) { //Here you can do stuff if the tray icon is doubleclicked TrayIcon.ShowBalloonTip(10000); }
public void StartCommand(string Operand, string Operation, bool Admin) { try { switch (Operation) { //case "df": //case "dnf": //case "ejsvk": //case "ev": // Fun.StartProgram("explorer.exe", "http://df.nexon.com/", Admin); // break; case "fhf": case "lol": case "fldhfp": Fun.StartProgram(@"C:\Riot Games\League of Legends\LeagueClient.exe", null, Admin); break; case "tmqo": case "qorm": case "tq": case "qr": case "tmxlaqorm": Fun.StartProgram("explorer.exe", "steam://rungameid/578080", Admin); break; case "tmxla": case "tx": case "steam": Fun.StartProgram(@"C:\Program Files (x86)\Steam\Steam.exe", null, Admin); break; case "dnjsrir": case "xlaqbdj": case "teamviewer": case "dr": case "xqd": case "xq": Fun.StartProgram(@"C:\Program Files (x86)\TeamViewer\TeamViewer.exe", null, Admin); break; case "apffhs": case "af": case "melon": Fun.StartProgram(@"C:\Program Files (x86)\Melon Player4\melon.exe", null, Admin); break; case "zmfha": case "rnrmfzmfha": case "googlechorme": case "chorme": Fun.StartProgram(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", null, Admin); break; case "shrtm": case "sr": case "nox": Fun.StartProgram(@"D:\Program Files\Nox\bin\Nox.exe", null, Admin); break; case "cpu": case "tlvldb": case "tvd": case "tlvldbdkdlel": case "tvdde": Fun.StartProgram(@"C:\Program Files\CPUID\HWMonitor\HWMonitor.exe", null, Admin); break; case "zkxhr": case "zkzkdhxhr": case "zzdx": case "zx": case "kakaotalk": Fun.StartProgram(@"C:\Program Files (x86)\Kakao\KakaoTalk\KakaoTalk.exe", null, Admin); break; case "eltmzhem": case "elzh": case "ez": case "discord": Fun.StartProgram(@"C:\Users\hyeon\AppData\Local\Discord\app-0.0.305\Discord.exe", null, Admin); break; case "vs": case "qlwndjftmxbeldh": case "vs2017": Fun.StartProgram(@"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe", null, Admin); break; case "flthtmdpelxj": case "flthtm": case "dpelxj": case "ftt": case "fttdex": case "resouce": case "resouceeditor": Fun.StartProgram(@"C:\Program Files (x86)\ResourceEditor.exe", null, Admin); break; case "dprtpf": case "excel": case "dt": Fun.StartProgram(@"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE", null, Admin); break; case "ppt": case "vkdnjvhdlsxm": case "vkvh": case "vlvlxl": Fun.StartProgram(@"C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE", null, Admin); break; case "gksrmf": case "gr": case "hangle": Fun.StartProgram(@"C:\Program Files (x86)\Hnc\Office 2018\HOffice100\Bin\Hwp.exe", null, Admin); break; case "gkstpf": case "gt1": case "hancell": Fun.StartProgram(@"C:\Program Files (x86)\Hnc\Office 2018\HOffice100\Bin\HCell.exe", null, Admin); break; case "gkspdf": case "pdf": Fun.StartProgram(@"C:\Program Files (x86)\Hnc\Office 2018\HOffice100\Bin\Hpdf.exe", null, Admin); break; case "gksty": case "gt2": case "hanshow": case "gksppt": case "hanppt": case "show": Fun.StartProgram(@"C:\Program Files (x86)\Hnc\Office 2018\HOffice100\Bin\HShow.exe", null, Admin); break; case "icue": Fun.StartProgram(@"C:\Program Files (x86)\Corsair\CORSAIR iCUE Software\iCUE.exe", null, Admin); break; case "dlzmfflqtm": case "dzft": case "eclipse": case "dlzmf": case "java": case "wkqk": case "wq": Fun.StartProgram(@"C:\Users\hyeon\eclipse\java-2019-06\eclipse\eclipse.exe", null, Admin); break; case "pycharm": case "python": case "vkdltjs": case "py": case "vdt": case "vdc": case "vkdlcka": Fun.StartProgram(@"C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\bin\pycharm64.exe", null, Admin); break; case "arduino": case "dkendlsh": case "deds": Fun.StartProgram(@"C:\Program Files (x86)\Arduino\arduino.exe", null, Admin); break; case "sql": case "znjfl": case "db": case "elql": case "epdxjqpdltm": Fun.StartProgram(@"C:\Program Files\HeidiSQL\heidisql.exe", null, Admin); break; case "vkdlfwlffk": case "ftp": case "vdwf": case "filezilala": case "vkdlftjqj": case "vdtq": Fun.StartProgram(@"C:\Program Files (x86)\FileZilla FTP Client\filezilla.exe", null, Admin); break; case "vpn": Fun.StartProgram(@"C:\Program Files\SoftEther VPN Client\vpncmgr_x64.exe", null, Admin); break; default: ICO.BalloonTipTitle = "프로그램 없음"; ICO.BalloonTipText = "[" + Operation + "]\n프로그램이 목록에 존재하지 않습니다."; ICO.ShowBalloonTip(1); break; } ClosingStatus = true; this.Close(); } catch (Exception ex) { ICO.BalloonTipTitle = "예외"; ICO.BalloonTipText = ex.Message.ToString(); ICO.ShowBalloonTip(1); } /* * * case "": * case "": * case "": * case "": * case "": * Fun.StartProgram(@"", null, Admin); * break; */ }
private void Sd_StorageDetected(object sender, StorageDetectorEventArgs e) { _notifyIcon.ShowBalloonTip(5000); _policyForm.Drive = e.Drive; _policyForm.Show(); }
public void ShowBalloonTip(string content, ToolTipIcon icon, int timeout = 3000) { notifyIcon.ShowBalloonTip(timeout, Setting.AppName, content, icon); }
private void SendToast(string heading, string message) { _notifyIcon.ShowBalloonTip(0, heading, message, ToolTipIcon.Info); }
private void ShowBalloon(object sender, EventArgs e) => trayIcon.ShowBalloonTip(2000, "Glucose", GetGlucoseMessage(), ToolTipIcon.Info);
public override void Execute(object parameter) { _notifyIcon.ShowBalloonTip(3000, "SingletonSean", "Be sure to subscribe.", ToolTipIcon.Info); }
public void NotifyIconMessage(int time, string title, string msg, ToolTipIcon icon) { notifyIcon.ShowBalloonTip(time, title, msg, icon); }
private void Button_Click(object sender, RoutedEventArgs e) { NotifyIcon.ShowBalloonTip("DownloadNovel", "来了,老弟儿~", NotifyIconInfoType.None, "mess"); }
/// <summary> /// Seperate thread to handle the Menu Items and Ballon tip popup /// </summary> private static void TaskOperation() { notifyIcon.ContextMenu = contextMenu; notifyIcon.Visible = true; notifyIcon.ShowBalloonTip(500, "Windows App", "Windows Tray App is Running...", ToolTipIcon.Info); }
private static void DueNotify(NotifyIcon notify) { string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\AssignmentReminder\settings.xml"; if (!File.Exists(path)) { return; } XDocument settings = XDocument.Load(path); var assignment = from c in settings.Root.Descendants("assignment") select c.Element("due").Value; bool duetoday = false; int dueamount = 0; int duesoon = 0; int overdue = 0; int totalassignments = 0; foreach (string dates in assignment) { DateTime date = DateTime.FromBinary(long.Parse(dates)); TimeSpan daysleft = date.Date - DateTime.Today; if (date.Date == DateTime.Today) { duetoday = true; dueamount++; } if (daysleft.TotalDays <= 2 && daysleft.TotalDays > 0) { duesoon++; } if (daysleft.TotalDays < 0) { overdue++; } totalassignments++; } if (totalassignments <= 0) { return; // Don't show popup if there aren't any assignments } if (duetoday && dueamount > 0) { notify.ShowBalloonTip(1, "Assignments Due", "You have " + dueamount.ToString() + " assignment(s) due today. Click to view them.", ToolTipIcon.Info); } else { if (overdue > 0) { notify.ShowBalloonTip(1, "No Assignments Due", "You have no assignments due today. You have " + overdue.ToString() + " overdue assignment(s).", ToolTipIcon.Info); } else if (duesoon > 0) { notify.ShowBalloonTip(1, "No Assignments Due", "You have no assignments due today. You have " + duesoon.ToString() + " assignment(s) due soon.", ToolTipIcon.Info); } else { notify.ShowBalloonTip(1, "No Assignments Due", "You have no assignments due today.", ToolTipIcon.Info); } } notify.BalloonTipClicked += BalloonTipClicked; }
public void Display() { ni.Visible = true; ni.ShowBalloonTip(3000); }
public void PopupNotify(string message, ToolTipIcon icon = ToolTipIcon.Info) { notifyIcon.ShowBalloonTip(3000, Server.Config.Name, message, icon); }
private void ControlFun() { if (State == State.Waiting || State == State.Stopped) { // 服务器、模式 需选择 if (ServerComboBox.SelectedIndex == -1) { MessageBoxX.Show(i18N.Translate("Please select a server first")); return; } if (ModeComboBox.SelectedIndex == -1) { MessageBoxX.Show(i18N.Translate("Please select a mode first")); return; } State = State.Starting; // 清除模式搜索框文本选择 ModeComboBox.Select(0, 0); Task.Run(() => { Task.Run(Firewall.AddNetchFwRules); var server = ServerComboBox.SelectedItem as Models.Server; var mode = ModeComboBox.SelectedItem as Models.Mode; if (_mainController.Start(server, mode)) { Task.Run(() => { State = State.Started; StatusTextAppend(LocalPortText(server.Type, mode.Type)); Bandwidth.NetTraffic(server, mode, _mainController); }); // 如果勾选启动后最小化 if (Global.Settings.MinimizeWhenStarted) { WindowState = FormWindowState.Minimized; if (_isFirstCloseWindow) { // 显示提示语 NotifyIcon.ShowBalloonTip(5, UpdateChecker.Name, i18N.Translate( "Netch is now minimized to the notification bar, double click this icon to restore."), ToolTipIcon.Info); _isFirstCloseWindow = false; } Hide(); } if (Global.Settings.StartedTcping) { // 自动检测延迟 Task.Run(() => { while (true) { if (State == State.Started) { server.Test(); // 重载服务器列表 InitServer(); Thread.Sleep(Global.Settings.StartedTcping_Interval * 1000); } else { break; } } }); } } else { State = State.Stopped; StatusText(i18N.Translate("Start failed")); } }); } else { Task.Run(() => { // 停止 State = State.Stopping; _mainController.Stop(); State = State.Stopped; }); Task.Run(TestServer); } }
public static void ShowBalloon(string title, string text, ToolTipIcon icon) { notifyIcon.ShowBalloonTip(5000, title, text, icon); }
public Boolean Initialize() { Application.ApplicationExit += new EventHandler(Application_ApplicationExit); Int32 port = _settings.Port; IPAddress ipAddr = _settings.LocalOnly ? IPAddress.Loopback : IPAddress.Any; ContextMenu ctxMenu = new ContextMenu(); ctxMenu.MenuItems.Add(new MenuItem("終了(&X)", ContextMenuItemExit)); _notifyIcon = new NotifyIcon(); _notifyIcon.Text = String.Format("{0} (IP: {1} / ポート {2})", Name, ipAddr, port); _notifyIcon.ContextMenu = ctxMenu; _notifyIcon.Icon = Resource.ApplicationIcon; Config.Default.EnableTrace = _settings.EnableTrace; Config.Default.IgnoreWatchError = _settings.IgnoreWatchError; Config.Default.Interval = _settings.Interval; Config.Default.ResolveTinyUrl = _settings.ResolveTinyUrl; Config.Default.EnableDropProtection = _settings.EnableDropProtection; Config.Default.SetTopicOnStatusChanged = _settings.SetTopicOnStatusChanged; Config.Default.IntervalDirectMessage = _settings.IntervalDirectMessage; //Config.Default.CookieLoginMode = _settings.CookieLoginMode; Config.Default.ChannelName = "#" + _settings.TwitterChannelName; Config.Default.EnableRepliesCheck = _settings.EnableRepliesCheck; Config.Default.IntervalReplies = _settings.IntervalReplies; Config.Default.DisableUserList = _settings.DisableUserList; Config.Default.BroadcastUpdate = _settings.BroadcastUpdate; Config.Default.ClientMessageWait = _settings.ClientMessageWait; Config.Default.BroadcastUpdateMessageIsNotice = _settings.BroadcastUpdateMessageIsNotice; Config.Default.POSTFetchMode = _settings.POSTFetchMode; Config.Default.EnableCompression = _settings.EnableCompression; Config.Default.DisableNoticeAtFirstTime = _settings.DisableNoticeAtFirstTime; _server = new Server(); _server.ConnectionAttached += new EventHandler <ConnectionAttachEventArgs>(_server_ConnectionAttached); if (!String.IsNullOrEmpty(_settings.OAuthClientKey)) { _server.OAuthClientKey = _settings.OAuthClientKey; } if (!String.IsNullOrEmpty(_settings.OAuthSecretKey)) { _server.OAuthSecretKey = _settings.OAuthSecretKey; } try { _server.Encoding = (String.Compare(_settings.Charset, "UTF-8", true) == 0) ? new UTF8Encoding(false) // BOM なし : Encoding.GetEncoding(_settings.Charset); } catch (ArgumentException) { _server.Encoding = Encoding.GetEncoding("UTF-8"); } // start try { _server.Start(ipAddr, port); _notifyIcon.Visible = true; _notifyIcon.ShowBalloonTip(1000 * 10, Name, String.Format("IRCサーバがポート {0} で開始されました。", port), ToolTipIcon.Info); } catch (SocketException se) { MessageBox.Show(se.Message, Name, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public void ShowMsg(string str, ToolTipIcon tooltip = ToolTipIcon.Info) { gIcon.ShowBalloonTip(3000, gIcon.BalloonTipTitle, str, tooltip); }
void _server_ConnectionAttached(object sender, ConnectionAttachEventArgs e) { _notifyIcon.ShowBalloonTip(1000 * 10, Name, String.Format("ユーザ {0} がサーバに接続しました。", ((Connection)(e.Connection)).TwitterUser.ScreenName), ToolTipIcon.Info); }
public void Show() { notifyIcon.Visible = true; notifyIcon.ShowBalloonTip(2, "Pomodoro", "Program counts down in the background!", ToolTipIcon.Info); }
private void Notify(String message) { NotifyIcon.ShowBalloonTip(5000, "EZBlocker", message, ToolTipIcon.None); }
public MyCustomApplicationContext() { Assembly _assembly = Assembly.GetExecutingAssembly(); Stream iconStream = _assembly.GetManifestResourceStream("AlwaysOnTop.icon.ico"); using (RegistryKey rkSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true)) { if (rkSettings == null) { Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AlwaysOnTop", RegistryKeyPermissionCheck.ReadWriteSubTree); } } RegistryKey regSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true); AoTBuild = Methods.TryRegString(regSettings, "Build", AlwaysOnTop.build, true); IP = Methods.TryRegString(regSettings, "Installation Path", AoTPath, true); RaL = Methods.TryRegInt(regSettings, "Run at Login", 0, false); UHK = Methods.TryRegInt(regSettings, "Use Hot Key", 0, false); HK = Methods.TryRegString(regSettings, "Hotkey", "", false); CT = Methods.TryRegInt(regSettings, "Use Context Menu", 0, false); UPM = Methods.TryRegInt(regSettings, "Use Permanent Windows", 0, false); PW = Methods.TryRegString(regSettings, "Windows by Title", "", false); DBN = Methods.TryRegInt(regSettings, "Disable Balloon Notify", 0, false); try { // Initialize Tray Icon trayIcon = new NotifyIcon() { Icon = new Icon(iconStream), ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("AlwaysOnTop", AoT), new MenuItem("Settings", Settings), new MenuItem("Help", HelpBox), new MenuItem("About", AboutBox), new MenuItem("Exit", Xit) }), Visible = true }; trayIcon.Click += TrayIcon_Click; if (DBN != 1) { trayIcon.ShowBalloonTip(5000, "AlwaysOnTop", "AlwaysOnTop is running in the background.", ToolTipIcon.Info); } if (CT == 1) /* call method to enabled titlebar context menu*/ } { if (UHK == 1 && HK != "") { string delim = "+"; String[] sHK = HK.Split(new string[] { delim }, StringSplitOptions.None); string modifier = sHK[0]; skey = sHK[1]; kMod = new Keys(); switch (modifier.ToLower()) { case "ctrl": kMod = Keys.Control; break; case "alt": kMod = Keys.Alt; break; case "shift": kMod = Keys.Shift; break; case "winkey": kMod = Keys.LWin; break; default: kMod = Keys.None; break; } TypeConverter keysConverter = TypeDescriptor.GetConverter(typeof(Keys)); key = (Keys)keysConverter.ConvertFromString(skey); gkh = new globalKeyboardHook(); gkh.HookedKeys.Add(kMod); gkh.HookedKeys.Add(key); gkh.KeyUp += new KeyEventHandler(keyup_hook); gkh.hook(); if (DBN != 1) { trayIcon.ShowBalloonTip(500, "Settings", kMod + "+" + key + " Hotkey registered", ToolTipIcon.Info); } } if (UPM == 1) /* call method to enabled titlebar context menu*/ } { }
/// <summary> /// 显示气泡 /// </summary> /// <param name="timeout">消失时间(毫秒)</param> /// <param name="title">标题</param> /// <param name="text">内容</param> /// <param name="icon">图标</param> public void ShowBalloonTip(int timeout, string title, string text, ToolTipIcon icon) { TrayIcon.ShowBalloonTip(timeout, title, text, icon); }
public void Notify(IEnumerable <Person> peopleWithBirthdayToday, IEnumerable <Person> peopleWithBirthdayInFuture) { _NotifyIcon?.ShowBalloonTip(_Time, "BirthdayReminder", PrepareMessage(peopleWithBirthdayToday), ToolTipIcon.None); }
private void ShowNotification(string name, bool status) { trayIcon.ShowBalloonTip(500, name, ((status) ? "Hat sich angemeldet" : "Hat sich abgemeldet"), ToolTipIcon.None); }