예제 #1
0
        private void FormSwitcher_Deactivate(object sender, EventArgs e)
        {
            Hide();
            timer1.Enabled = false;
            RenderType     = Program.settings.DefaultDataFlow;
            RefreshDevices(RenderType);
            VolBar.RegisterDevice(RenderType);

            var iconpos  = WindowPosition.GetNotifyIconArea(notifyIcon);
            var iconrect = new Rectangle(iconpos.left, iconpos.top, iconpos.right - iconpos.left, iconpos.bottom - iconpos.top);

            if (iconrect.Contains(Cursor.Position))
            {
                DeactivatedOnIcon = true;
            }
        }
예제 #2
0
        private void FormSwitcher_Deactivate(object sender, EventArgs e)
        {
            if (Disposing || Program.settings.AlwaysVisible)
            {
                return;
            }

            Hide();
            timer1.Enabled = false;
            RenderType     = Program.settings.DefaultDataFlow;
            RefreshDevices(RenderType);
            VolBar.RegisterDevice(RenderType);

            var rect     = WindowPosition.GetNotifyIconArea(notifyIcon);
            var iconrect = new Rectangle((int)(rect.left / DpiFactor), (int)(rect.top / DpiFactor), (int)(rect.right / DpiFactor) - (int)(rect.left / DpiFactor), (int)(rect.bottom / DpiFactor) - (int)(rect.top / DpiFactor));

            if (iconrect.Contains(Cursor.Position))
            {
                DeactivatedOnIcon = true;
            }
        }