SkysLastChance Posted October 26, 2021 Posted October 26, 2021 (edited) I am trying to move two windows so they fit on the same screen. I would like one window to be 1/4 the screen and the Other to be 3/4 of the screen. (One on top of the other not side by side.) Is it possible to get this to work with all monitor sizes? Local $hRun1 = _Run('notepad.exe', 0,((@DesktopWidth + 50)/2),@DesktopWidth,@DesktopHeight/1.75) Local $hRun2 = _Run('notepad.exe', 0, 0, @DesktopWidth,@DesktopHeight/1.25) Func _Run($sRunCommand, $iX, $iY, $iW, $iH) Local $aWinList_Before = WinList("[CLASS:Notepad]") Run($sRunCommand) Do $aWinList_After = WinList("[CLASS:Notepad]") Until $aWinList_After[0][0] > $aWinList_Before[0][0] Local $hWnd = $aWinList_After[1][1] Sleep(1000) WinMove($hWnd, "", $iX, $iY, $iW, $iH) EndFunc Edited October 26, 2021 by SkysLastChance You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
Solution Subz Posted October 26, 2021 Solution Posted October 26, 2021 Wouldn't it be something like: Local $hRun2 = _Run('notepad.exe', 0, 0, @DesktopWidth,@DesktopHeight/3) Local $hRun1 = _Run('notepad.exe', 0,@DesktopHeight/3,@DesktopWidth,@DesktopHeight/3 * 2) Func _Run($sRunCommand, $iX, $iY, $iW, $iH) Local $aWinList_Before = WinList("[CLASS:Notepad]") Run($sRunCommand) Do $aWinList_After = WinList("[CLASS:Notepad]") Until $aWinList_After[0][0] > $aWinList_Before[0][0] Local $hWnd = $aWinList_After[1][1] Sleep(1000) WinMove($hWnd, "", $iX, $iY, $iW, $iH) EndFunc SkysLastChance 1
SkysLastChance Posted October 27, 2021 Author Posted October 27, 2021 (edited) I ended up going with this. I appreciate the help as always @Subz Local $hRun1 = _Run('notepad.exe', 0,0,@DesktopWidth,@DesktopHeight/4 * 3) Local $hRun2 = _Run('notepad.exe', 0, @DesktopHeight/4 * 3, @DesktopWidth,@DesktopHeight/4) Func _Run($sRunCommand, $iX, $iY, $iW, $iH) Local $aWinList_Before = WinList("[CLASS:Notepad]") Run($sRunCommand) Do $aWinList_After = WinList("[CLASS:Notepad]") Until $aWinList_After[0][0] > $aWinList_Before[0][0] Local $hWnd = $aWinList_After[1][1] Sleep(1000) WinMove($hWnd, "", $iX, $iY, $iW, $iH) EndFunc Edited October 27, 2021 by SkysLastChance You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now