09-20-2022, 07:32 PM
Hello,
I have been trying to find a way to "tile" an array of windows based on the screen resolution and just can't figure it out.
Thus far I have put the following together. The example below uses notepad.exe, but my use case is a different application.
If anyone has so input on this I would be very thankful
I have been trying to find a way to "tile" an array of windows based on the screen resolution and just can't figure it out.
Thus far I have put the following together. The example below uses notepad.exe, but my use case is a different application.
using System.Windows;
using System.Collections.Generic;
var r = screen.primary.Rect;
//print.it(r.Width);
//print.it(r.Height);
var windows = wnd.findAll(cn: "Notepad", of: "notepad.exe");
var count = windows.Length;
//print.it(count);
int width = r.Width/count;
print.it(width);
int height = r.Height/count;
print.it(height);
int x = 0;
int y = 10;
for (int i = 0; i < count; i++) {
print.it(windows[i]);
windows[i].Resize(width,height);
windows[i].MoveInScreen(x,y);
x = x + ???;
y = y + ???;
}