//http://stackoverflow.com/a/4555214 public bool moveToPoint(decimal x, decimal y) { List <INPUT> mouseInputList = new List <INPUT>(); INPUT mouseEvent = new INPUT() { }; mouseEvent.tipo = TIPO_MOUSEVENT; //Si pongo de la manera directa sin MouseFlags.MOUSEEVENTF_ABSOLUTE en el parametro de flag, resulta que simplemente suma a la posición actual del raton. //La manera correcta es la siguiente mouseEvent.data.mouse.dx = Convert.ToInt32(x * (65536.0m / ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CXSCREEN))); //Se recomienda usar 65536.0f. mouseEvent.data.mouse.dy = Convert.ToInt32(y * (65536.0m / ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CYSCREEN))); mouseEvent.data.mouse.mouseData = 0; mouseEvent.data.mouse.time = 0; mouseEvent.data.mouse.dwExtraInfo = new IntPtr(-1); //Coloco esto como flag para saber cuando es automatizado //mouseEvent.data.mouse.dwExtraInfo = ControllerSystemInfo.GetMessageExtraInfo(); mouseEvent.data.mouse.dwFlags = (uint)MouseFlags.MOUSEEVENTF_ABSOLUTE | (uint)MouseFlags.MOUSEEVENTF_MOVE; if (SendInput(1, ref mouseEvent, Marshal.SizeOf(typeof(INPUT))) == 0) { MessageBox.Show("Ha fallado el remplazo del evento en MouseHook. Codigo error -->" + Marshal.GetLastWin32Error()); } return(false); }
POINT ptMaxTrackSize; // x = SM_CXMAXTRACK || y = SM_CYMAXTRACK MINMAXINFO(POINT ptMaxSize, POINT ptMaxPosition) { this.ptReserved = new POINT(); this.ptMaxSize = ptMaxSize; this.ptMaxPosition = ptMaxPosition; this.ptMinTrackSize = new POINT(ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CXMINTRACK), ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CYMINTRACK)); this.ptMaxTrackSize = new POINT(ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CXMAXTRACK), ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CYMAXTRACK)); }
private void resizingForm() { Size maxSize = Utilidades.calculateMaxSize(this.listViewModules); this.tabModulos.Size = maxSize; this.listViewModules.Size = maxSize; //this.listViewNetwork.Size = maxSize; this.MaximumSize = new Size(ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CXFULLSCREEN), ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CYFULLSCREEN)); }
private void resizingForm() { this.listProcessView.Size = Utilidades.calculateMaxSize(this.listProcessView); this.MaximumSize = new Size(ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CXFULLSCREEN), ControllerSystemInfo.getSystemInfo(ControllerSystemInfo.SystemMetric.SM_CYFULLSCREEN)); }