Exemplo n.º 1
0
 private void compararPosMouse(object sender, EventArgs e)
 {
     if (ClMouse.GetCursorPos(ref posActu))
     {
         if (posActu.Y <= 5)
         {
             tmPosMouse.Start();
         }
         else
         {
             if (posActu.Y >= pantalla.Bounds.Height - 5)
             {
                 tmPosMouse.Start();
             }
             else
             {
                 if (posActu.X <= 5)
                 {
                     tmPosMouse.Start();
                 }
                 else
                 {
                     tmPosMouse.Stop();
                 }
             }
         }
     }
     posAnt = posActu;
 }
Exemplo n.º 2
0
 private void FrmMain_MouseLeave(object sender, EventArgs e)
 {
     ClMouse.PUNT posMouse = new ClMouse.PUNT();
     ClMouse.GetCursorPos(ref posMouse);
     if (posMouse.Y > 200)
     {
         tmDesplegar.Stop();
         tmMirarPosMouse.Start();
         Height           = 0;
         this.WindowState = FormWindowState.Minimized;
     }
 }
Exemplo n.º 3
0
        private void openPanel(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;

            //anchoMax = this.Bounds.Width;
            this.WindowState = FormWindowState.Normal;
            this.Location    = new Point(0, 0);
            Height           = 0;
            Width            = anchoMax;
            this.Focus();
            //Visible = false;
            Refresh();
            ClMouse.GetCursorPos(ref posActu);
            if (posActu.Y <= 5)
            {
                if (posActu.X >= 0 && posActu.X <= this.Bounds.Width / 2)
                {
                    //abrimos el panel de modulos
                    tmPosMouse.Stop();
                    abrirModulos();
                    //MessageBox.Show("Modulos");
                }
                else
                {
                    if (posActu.X > this.Bounds.Width / 2 && posActu.X <= this.Bounds.Width)
                    {
                        //abrimos el panel de perfiles
                        abrirPerfiles();
                        //MessageBox.Show("Perfiles");
                    }
                }
            }
            else
            {
                if (posActu.Y >= pantalla.Bounds.Height - 5)
                {
                    if (obtenerQttDeUnProcess("osk") < 1)
                    {
                        //encenderProcess("osk.exe", "osk"); //Preguntar si tengo que poner toda la ruta
                    }
                }
                else
                {
                    if (posActu.X <= 5)
                    {
                        abrirAccesosDirectos();
                    }
                }
            }
            tmPosMouse.Stop();
        }
Exemplo n.º 4
0
 private void minimizarForm(object sender, EventArgs e)
 {
     ClMouse.PUNT posMouse = new ClMouse.PUNT();
     ClMouse.GetCursorPos(ref posMouse);
     if (posMouse.Y > 200 && (WindowState == FormWindowState.Maximized || WindowState == FormWindowState.Normal))
     {
         if (!frmIsOpen("FrmPerfilUser") && !frmIsOpen("FrmAccesosDirectos") && !frmIsOpen("FrmEliminarUser") && !frmIsOpen("FrmEliminarModulo"))
         {
             tmDesplegar.Stop();
             tmMirarPosMouse.Start();
             Height           = 0;
             this.WindowState = FormWindowState.Minimized;
         }
     }
 }
Exemplo n.º 5
0
 private void FrmMain_Load(object sender, EventArgs e)
 {
     this.WindowState = FormWindowState.Maximized;
     anchoMax         = this.Bounds.Width;
     Height           = 0;
     Refresh();
     this.WindowState = FormWindowState.Minimized;
     //MessageBox.Show(pantalla.Bounds.Height.ToString()+","+ pantalla.Bounds.Width.ToString());
     posAnt.X = -99;
     posAnt.Y = -99;
     ClMouse.GetCursorPos(ref posActu);
     tmPosMouse.Tick      += openPanel;
     tmMirarPosMouse.Tick += compararPosMouse;
     tmDesplegar.Tick     += desplegarForm;
     tmMouseLeave.Tick    += minimizarForm;
     tmMirarPosMouse.Start();
     encenderProcess(Application.StartupPath + "\\KinectV2MouseControl.exe", "KinectV2MouseControl");
 }