Пример #1
0
 private void BtnStart_Click(object sender, EventArgs e)
 {
     if (label1.Text != "Choose Save Location:")
     {
         try
         {
             this.Hide();
             notifyIcon1.BalloonTipIcon  = ToolTipIcon.Info;
             notifyIcon1.BalloonTipText  = "I'm Running Here";
             notifyIcon1.BalloonTipTitle = "Hey!";
             notifyIcon1.ShowBalloonTip(3000);
             notifyIcon1.ContextMenuStrip = contextMenuStrip1;
             _RegisKey.Keys         = Keys.PrintScreen;
             _RegisKey.ModKey       = 0;
             _RegisKey.WindowHandle = this.Handle;
             _RegisKey.HotKey      += new RegisterHotKeyClass.HotKeyPass(checkIfKeyPressed);
             _RegisKey.StarHotKey();
         }
         catch { }
     }
     else
     {
         MessageBox.Show("Choose Saving Path");
     }
 }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //加载命令
            cmdManager.reLoadCmds(null);

            //注册热键
            RegisterHotKeyClass _RegisKey = new RegisterHotKeyClass();

            _RegisKey.Keys         = Keys.C;
            _RegisKey.ModKey       = RegisterHotKeyClass.MODKEY.MOD_ALT;
            _RegisKey.WindowHandle = this.Handle;
            _RegisKey.HotKey      += new RegisterHotKeyClass.HotKeyPass(_Regis_HotKey);
            _RegisKey.StarHotKey();
        }