I'm working on creating python code with pywinauto to automate the process of setting two Minecraft clients into splitscreen.
After preparing it all the last step is to have one instance of Minecraft to be 0x0x1920x540 and the other to be at 0x540x1920x540. But because both instances have the exact same name I am only able to select and move one, is there a way to somehow select both simultaneously and arrange above and below?
from pywinauto.application import Application
from pywinauto import taskbar
from pywinauto import keyboard
import pywinauto
import win32gui
import time
app = Application(backend="uia").start('D:\Games\Minecraft\MinecraftLauncher.exe')
dlg_spec = app.window(title='Minecraft Launcher')
time.sleep(3)
keyboard.SendKeys("{TAB}")
keyboard.SendKeys("{ENTER}")
time.sleep(3)
keyboard.SendKeys("{TAB}")
time.sleep(0.3)
keyboard.SendKeys("{TAB}")
time.sleep(0.3)
keyboard.SendKeys("{TAB}")
time.sleep(0.3)
keyboard.SendKeys("{ENTER}")
keyboard.SendKeys("{TAB}")
keyboard.SendKeys("{TAB}")
keyboard.SendKeys("{TAB}")
keyboard.SendKeys("{ENTER}")
time.sleep(10)
app = Application(backend="uia").start('border_stripper.exe')
dlg_spec = app.window(title='Border Stripper')
app.Dialog['Minecraft 1.11.2ListItem2'].select()
app.Dialog.Button1.click()
app.Dialog['Minecraft 1.11.2ListItem0'].select()
app.Dialog.Button1.click()
hwnd = win32gui.FindWindow(None, "Minecraft 1.11.2")
win32gui.MoveWindow(hwnd, 0, 0, 1920, 540, True)
#hwnd2 doesn't do anything because both windows appear as "Minecraft 1.11.2"
hwnd2 = win32gui.FindWindow(None, "Minecraft 1.11.2(2)")
win32gui.MoveWindow(hwnd2, 0, 540, 1920, 540, True)
Setting the default Minecraft window size to to 1920x520 will make it so that both windows appear in the top half of the screen and therefore only requires moving one to the bottom half.