static int Main(string[] args)
        {
            if (args.Length == 1)
            {
                if (args[0] == RegMapCapsLock.CommandMap)
                {
                    RegMapCapsLock.SetCommandLine();
                }
                if (args[0] == RegMapCapsLock.CommandReset)
                {
                    RegMapCapsLock.ResetCommandLine();
                }
                return(0);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (var context = new NotifyIconContext())
                using (var level = new LevelWatcher())
                    using (var hotkey = new GlobalHotKey())
                        using (var timer = new MuteTimer())
                            using (var keymon = new KeyMonitoring())
                            {
                                Application.Run(context);
                                return(0);
                            }
        }
 void ResetCapsLock(object sender, EventArgs e)
 {
     RegMapCapsLock.Reset();
     trayIcon.ShowBalloonTip(10000, "Restart Windows", "Log out and back in to complete the reset.", ToolTipIcon.Info);
 }
 void MapCapsLock(object sender, EventArgs e)
 {
     RegMapCapsLock.Set();
     trayIcon.ShowBalloonTip(10000, "Restart Windows", "Log out and back in to activate the map.", ToolTipIcon.Info);
 }