/// <summary> /// Update coordiantes of this windows. /// /// When the window is moved and the changes need to be saved then this function updates the changes. /// </summary> internal void UpdatePosition() { LgRectangle rec = LgProcessManager.GetWindowRectange(Process); TopLeft.X = rec.X1; TopLeft.Y = rec.Y1; Size = rec.GetSize(); }
/// <summary> /// Add new Window to the config from a coordinate in the screen. Usually from a mouse click. /// </summary> /// <param name="point">point in screen</param> /// <returns></returns> internal Boolean AddWindow(LgPoint point) { Boolean result = true; Process p = LgProcessManager.GetProcessAtCoordiante(point); // before adding check if it is current process if (!LgProcessManager.IsCurrentProcess(p)) { LgProcess process = LgProcess.FromProcess(p); LgRectangle rec = LgProcessManager.GetWindowRectange(process); LgWindow window = new LgWindow(rec.GetTopLeft(), rec.GetSize(), process); // add to list Windows.Add(window); Console.WriteLine(window); } else { result = false; } return(result); }