Jump to content

Window not restored correctly after manual minimize


Go to solution Solved by Leendert-Jan,

Recommended Posts

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.

2021-09-20 16-48-12.gif

Edited by NoiseMiler
Add version info
Link to post
Share on other sites

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)

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...