Esempio n. 1
0
        //窗体加载事件, 在窗体加载前触发, 此时窗体尚未加载

        /*private void TrayCheat_Load(object sender, EventArgs e)
         * {
         *  MessageBox.Show("窗体加载中......", "提示");
         * }*/

        //窗体激活事件, 每次窗体被激活(选中), 都会触发这个方法

        /*private void TrayCheat_Activated(object sender, EventArgs e)
         * {
         *  MessageBox.Show("窗体被激活", "提示");
         * }*/
        #endregion

        //当窗体第一次显示前, 会执行这个方法, 此时窗体已经加载完毕
        private void TrayCheat_Shown(object sender, EventArgs e)
        {
            //MessageBox.Show("这是窗体的第一次显示", "提示");
            currentWindowPtr = WindowsForm.MyGetForegroundWindow();//获取窗口句柄, 必须在窗口被激活之后执行这句代码

            notifyIcon_360.Text              = @"360安全卫士 - 安全防护中心完全开启";
            notifyIcon_360.Icon              = icon_360;
            notifyIcon_360.MouseDoubleClick += NotifyIcon_TrayCheat_MouseDoubleClick;

            notifyIcon_360bug.Text              = @"360杀毒 - 文件系统实时防护已开启";
            notifyIcon_360bug.Icon              = icon_360bug;
            notifyIcon_360bug.MouseDoubleClick += NotifyIcon_TrayCheat_MouseDoubleClick;

            //打开定时器
            Timer_IconEffect.Start();

            //修改按钮文本显示
            switch (currentIconEffect)
            {
            case EffectFlickOrSpin.Effect_Spin:
                ICONEffect.Text = "当前图标效果: 旋转";
                break;

            case EffectFlickOrSpin.Effect_Flick:
                ICONEffect.Text = "当前图标效果: 闪烁";
                break;

            case EffectFlickOrSpin.Effect_Still:
                ICONEffect.Text = "当前图标效果: 无";
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
 //事件: 双击托盘栏图标, 还原窗口
 private void NotifyIcon_TrayCheat_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         WindowsForm.OnClickRestore(currentWindowPtr);
     }
 }
Esempio n. 3
0
 //隐藏窗口 按钮
 private void HideWindow_Click(object sender, EventArgs e)
 {
     if (notifyIcon_360.Visible == true ||
         notifyIcon_360bug.Visible == true ||
         NotifyIcon_TrayCheat.Visible == true)
     {
         WindowsForm.OnClickHide(currentWindowPtr);
     }
 }
Esempio n. 4
0
 //隐藏窗口
 private void ToolStripMenu_Hide_Click(object sender, EventArgs e)
 {
     //如果图标都不存在了, 则不能隐藏窗口
     if (notifyIcon_360.Visible == true ||
         notifyIcon_360bug.Visible == true ||
         NotifyIcon_TrayCheat.Visible == true)
     {
         WindowsForm.OnClickHide(currentWindowPtr);
     }
 }
Esempio n. 5
0
 //还原窗口
 private void ToolStripMenu_Restore_Click(object sender, EventArgs e)
 {
     WindowsForm.OnClickRestore(currentWindowPtr);
 }