public static void Stop(FrmMain p) { if (clientMode == 1) //save freeform settings { Config.Default.freeformLayoutData = ""; foreach (Client c in p.clients) { Point location = Native.GetWindowLocation(c.clientProcess); Size size = Native.GetWindowSize(c.clientProcess); location = p.splitMain.PointToClient(location); Config.Default.freeformLayoutData += "" + location.X + "," + //X pos location.Y + "," + //Y pos size.Width + "," + //Width size.Height + "|"; //Height } } foreach (Client c in p.clients) { if (!c.clientProcess.HasExited) { c.clientProcess.Kill(); } } p.clients.Clear(); }
private Point RelativePosition(Point pos, System.Diagnostics.Process p) { Size actual = Native.GetWindowSize(p); //size of the other window float percentX = (float)actual.Width / (float)pbxClient.Size.Width; // other window / the one that was clicked float percentY = (float)actual.Height / (float)pbxClient.Size.Height; // other window / the one that was clicked return(new Point((int)(percentX * pos.X), (int)(percentY * pos.Y) - (ConfigurationManager.clientMode == 0 ? 20 : 40))); //-20 due to menu bar offset }