NoiseMiler Posted September 20, 2021 Share Posted September 20, 2021 (edited) I have a dual monitor setup. Below is a very simple script that runs Windows Terminal and moves it to my right-hand monitor (secondary). Run('wt.exe -p "Windows PowerShell"') local $asd = WinWait("[CLASS:CASCADIA_HOSTING_WINDOW_CLASS]") WinMove($asd,'', 1000, 0) Now why, for the life of me, is the window appearing on my main monitor if I manually minimize and click again on it? I want it to be back where it was (on the second monitor). AutoIt Version: V3.3.14.5 [X32] Windows Version: WIN_10/2009 [X64] See also the attached gif. Edited September 20, 2021 by NoiseMiler Add version info Link to comment Share on other sites More sharing options...
Solution Leendert-Jan Posted September 21, 2021 Solution Share Posted September 21, 2021 When the terminal window is started, it is already maximized. Maybe it would stay at it's position when you: Open the terminal window normally Move it to your second monitor Maximize it there (using WinSetState()) Link to comment Share on other sites More sharing options...
Danp2 Posted September 21, 2021 Share Posted September 21, 2021 I'm guessing that Windows doesn't detect that the terminal window is fully on the second monitor. I suggest that you use the Au3Info tool to check the window coordinates after you manually move the window to the second monitor. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NoiseMiler Posted September 23, 2021 Author Share Posted September 23, 2021 Thanks for your answers. I solved it using @Leendert-Jan's advice. Disabling `"launchMode": "maximized",` from the WT settings, then using WinMove and WinSetState(...@SW_MAXIMIZE) does it. @Danp2 I couldn't get a real difference neither in window coordinates nor in other useful parameters with Au3Info in both scenarios (i.e. window returning to the main monitor after minimizing vs. window moved manually) Leendert-Jan 1 Link to comment Share on other sites More sharing options...
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