ShowBalloonTip() private method

Invokes WinApi.Shell_NotifyIcon in order to display a given balloon ToolTip.
private ShowBalloonTip ( string title, string message, BalloonFlags flags, IntPtr balloonIconHandle ) : void
title string The title to display on the balloon tip.
message string The text to display on the balloon tip.
flags BalloonFlags Indicates what icon to use.
balloonIconHandle IntPtr A handle to a custom icon, if any, or /// .
return void
        public MainWindow()
        {
            InitializeComponent();

            // Get the taskbar icon object
            Tb = this.ProcessNotifyIcon;
            Tb.ToolTipText = Properties.Resources.ProgramName;

            // Set window title
            this.Title = Properties.Resources.ProgramName;

            // Initial setting
            CurrentStatus = ProcessStatus.Stopped;
            UpdateIcon();

            // Don't show window
            SetWindowVisibility(false);

            // Load the settings
            LoadSettings();

            // Start the checking process
            StartCheckProcess();

            if (ShowBalloonMessageOnStart)
            {
                Tb.ShowBalloonTip(Properties.Resources.ProgramName, "Started", BalloonIcon.Info);
            }
        }
示例#2
1
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            tb = (TaskbarIcon)FindResource("MyNotifyIcon");

            var viewModel = new StahpViewModel();
            viewModel.Notify += (s, evt) => tb.ShowBalloonTip("Stahp!!!", "Time's up.", BalloonIcon.Error);

            tb.DataContext = viewModel;
        }
示例#3
0
        // Adds the notification icon
        public void AddTaskbarIcon()
        {
            // The display text of the icon
            string DisplayText = "MouseControl running at " + WebServer.runningIp;
            systemIcon = new TaskbarIcon();
            systemIcon.Icon = new System.Drawing.Icon(typeof(App), "MouseControlIcon.ico");
            systemIcon.ToolTipText = DisplayText;
            systemIcon.ShowBalloonTip("MouseControl", DisplayText, BalloonIcon.Info);

            // Remove the text after a certain amount of time
            Thread.Sleep(6000);
            systemIcon.HideBalloonTip();

            // Add context menu
            ContextMenu cMenu = new ContextMenu();

            MenuItem about = new MenuItem();
            about.Header = "About";
            about.Click += aboutClick;

            MenuItem exit = new MenuItem();
            exit.Header = "Exit";
            exit.Click += exitClick;

            cMenu.Items.Add(about);
            cMenu.Items.Add(exit);

            // Add System tray icon click handler
            systemIcon.TrayMouseDoubleClick += SystemTrayIconClick;

            systemIcon.ContextMenu = cMenu;
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");

            notifyIcon.ShowBalloonTip("Beba Água", "Beba água iniciado!", BalloonIcon.Info);
        }
示例#5
0
        /// <summary>
        /// Create our hotkey on startup, initialize notifyicon
        /// TBI -- Customize hotkey combination via options right click
        /// </summary>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");

            var _hotKey = new KeyboardHook(Key.Space,KeyModifier.Ctrl, OnHotKeyHandler);

            notifyIcon.ShowBalloonTip("Window Butler Started", "Press [CTRL] + [SPACE]", BalloonIcon.Info);
        }
示例#6
0
文件: App.xaml.cs 项目: oduma/MySynch
 private void InitApplication()
 {
     //initialize NotifyIcon
     tb = (TaskbarIcon)FindResource("MyNotifyIcon");
     tb.ToolTipText = "MySynch Monitor";
     tb.ShowBalloonTip("MySynch Monitor", "Starting the monitor", BalloonIcon.Info);
     StartTheMonitor();
     ((MenuItem)tb.ContextMenu.Items[0]).Command=new RelayCommand(LaunchMapEditor);
     ((MenuItem)tb.ContextMenu.Items[1]).Command = new RelayCommand(LaunchMonitor);
     ((MenuItem)tb.ContextMenu.Items[2]).Command = new RelayCommand(CloseAll);
     Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
 }
示例#7
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     MainWindow = new MainWindow();
     loadSettings();
     _notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
     _listener = new HttpListener();
     string prefixes = String.Format(@"http://+:{0}/", _port);
     _listener.Prefixes.Add(prefixes);
     _listener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;
     try
     {
         _listener.Start();
         _listenerTh = new Thread(startListener) {Name = @"HTTPListener Thread"};
         _listenerTh.SetApartmentState(ApartmentState.STA);
         _listenerTh.Start();
         string text = String.Format("{0}:{1}", Utilities.localIpAddress(), _port);
         if (_notifyIcon != null) _notifyIcon.ShowBalloonTip(@"Server Started", text, _notifyIcon.Icon);
     }
     catch
     {
         if (_notifyIcon != null) _notifyIcon.ShowBalloonTip(@"Error", "Failed to start server, could not bind port.", BalloonIcon.Error);
     }
 }
示例#8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            if (e.Args.Contains("/uninstall"))
            {
                new UninstallWindow().Show();
                return;
            }

            Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;

            Icon = new TaskbarIcon
            {
                IconSource =
                    new BitmapImage(new Uri(
                        @"pack://application:,,,/GamerJail;component/Resources/Icon.ico", UriKind.Absolute)),
                ToolTipText = "GamerJail"
            };
            Icon.TrayLeftMouseDown += Tbi_TrayLeftMouseDown;

            ServiceManager.Current.Load(Icon);

            if (ServiceManager.Current.Config.ProtectionLevel == ProtectionLevel.Nothing)
            {
                Icon.ContextMenu = new ContextMenu();
                var item = new MenuItem { Header = "Beenden" };
                item.Click += (sender, args) => Current.Shutdown();
                Icon.ContextMenu.Items.Add(item);
            }

            if (e.Args.Contains("/firstStart"))
                Icon.ShowBalloonTip("GamerJail",
                    "GamerJail wurde gestartet und ist nun aktiv.", BalloonIcon.Info);

            Current.Exit += Current_Exit;
            Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
        }
示例#9
0
        public void checkImap(ImapClient imap,TaskbarIcon icon)
        {
            if (imap.Connect())
            {
                int getMailCnt;
                if (type == MAIL_TYPE.GMAIL) getMailCnt = imap.GetMailList().Count();
                else getMailCnt = yMailCntGet(imap.GetMailBox());

                if (getMailCnt != mailCnt)
                {
                    if (getMailCnt > mailCnt)
                    {
                        int newCnt = getMailCnt - mailCnt;
                        icon.ShowBalloonTip("メールの通知", "新着メール " + newCnt + "件", BalloonIcon.Info);

                    }
                    mailCnt = getMailCnt;
                }
                //string msg = "getMailCnt:" + getMailCnt + "件\nmailCnt:" + mailCnt;
                //icon.ShowBalloonTip("メールの通知", msg, BalloonIcon.Info);
            }
            
        }
示例#10
0
 void StreamPlayer_OnRecordingStopped(object sender, EventArgs e)
 {
     this.MainWindowContext.Dispatcher.Invoke(new Action(delegate()
     {
         using(var taskbarIcon = new TaskbarIcon())
         {
             taskbarIcon.ShowBalloonTip(this.MainWindowContext.FindResource("AppName").ToString(), this.MainWindowContext.FindResource("RecordingStoppedDialog").ToString(), BalloonIcon.Info);
         }
     }));
 }