Exemplo n.º 1
0
        static void Main()

        {
            const string appName = "BatteryPercentage";
            bool         isAnotherInstanceOpen;
            var          mutex = new System.Threading.Mutex(true, appName, out isAnotherInstanceOpen);

            if (!isAnotherInstanceOpen)
            {
                //app is already running! Exiting the application
                string message = "Only one instance of this app is allowed (App already running).";
                string title   = "BatteryPercentage";

                MessageBox.Show(message, title);
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            NotifIcon trayIcon = new NotifIcon();

            Application.Run();
        }
Exemplo n.º 2
0
 private void settingChanged_Click(object sender, EventArgs e)
 {
     NotifIcon.setSetting(lowbatValue.Text, alertValue.Checked);
     this.Hide();
 }