I'm sure some of you switched between Eyefinity/Surround (or both together known as SLS - Single Large Surface) multiple times a day. And every time all windows positions have been totally messed up. Well, tonight i had enough of that. I've used AutoIT to write a simple tool which runs in the Background and automatically repositions all my open Windows when i switch from Extended Mode to Eyefinity or back.
You can see it in Action in this short Youtube clip:
How does it work? Every 2 Seconds a List of all Windows which are not minimized is created. it checks in this list if the Main Monitor is on the Top Left Corner or not. If you have any monitor left from your Main Monitor it will detect a Extended Setup. if you switch to Eyefinity/Surround it detects that change and knows top right corner is on 0 0 and not -1920 0 anymore. After a Delay of 22 seconds (Yes, it really takes over 20 seconds for Radeon Settings to Switch to Eyefinity and get the Radeon settings Menu back online with the Eyefinity specific settings) all the Windows will be moved to the Position 6 seconds before the change has been detected. This also works the other way around. Switching back from Eyefinity to Extended takes a 3 seconds delay and then moves all the windows as they have been 6 seconds before the detected change.
Does it Work with nVidia Surround? It should.... most Likely... i have no possiblity to test it but if it doesn't take longer than 22 seconds to setup Surround after the Desktop Resolution has changed it should.
What Operating Systems? Tested on Windows 10! 8.1 most likely works too. 7 and Vista might work. The compiled .exe is x86
Does it work with Bezel Correction? Yes, after version 1.0.1
Does it work with 3440x1400? Currently not, it's optimized for 1920 width monitors. But if you change the Values yourself there is no reason why it wouldn't.
Virus detected! It's an AutoIt script compiled into an .exe they often are missdetected as a virus. If you don't trust the .exe simply copy the code and compile it yourself.
Changelog: v1.0.4 08.01.2015 modified the Delay. It's preset to 1second and waits as long as it takes until it can move a window before it continues. Might cause problems if you close or minimze a window in that moment when you switch to EF. Increase Dealy to prevent this.
v1.0.3 30.12.2015 fixed the pause function Added a "Start at Boot" functionality
v1.0.2 28.12.2015 Added a GUI for setting up bezel correction and Delays Added a Tray Icon with Settings/Pause/Exit functions Added a settings.ini file which stores all settings for reboot Added security to prevent the script from running twice Set an Icon Should now support every 3x1L or 3x1P Setup
V1.0.1 26.12.2015 Added Bezel correction.
V1.0.0 Initial Release 26.12.2015
Here you have the full AutoIt code: A compiled .exe is attached below.
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=mm.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Fileversion=1.0.4.0 #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.12.0 Author: Haldi
Script Function: Moves Windows into correct Position after switching to Eyefinity / Surround
#Region Load Settings / First Boot If FileExists($iniName) = 1 Then ToolTip(" ",@DesktopWidth/2, @DesktopHeight/2,"Starting Script",1, 2) Sleep(500) ToolTip("") $sBezelcorrection = IniRead($iniName, "Settings", "Bezelcorrection", "") $sXwidth = IniRead($iniName, "Settings", "ExtendedWidth", "") Else MsgBox(262144, "First Start", "Please take a moment and configure your Bezelcorrection"&@CRLF&@CRLF&"You can find this Menu by clicking the Tray Icon") GUI() EndIf #EndRegion
Func Exitscript() Exit EndFunc
Func Pause() If TrayItemGetState($trayPause) = 68 Then TrayItemSetState($trayPause, $TRAY_CHECKED) $pause =1 ElseIf TrayItemGetState($trayPause) = 65 Then TrayItemSetState($trayPause, $TRAY_UNCHECKED) $pause =0 If @DesktopWidth/@DesktopHeight> 2.4 Then $sSLSmode = 1 ;Aspectratio bigger than 21:9 Detected, SLS Activate Else $sSLSmode = 0 EndIf EndIf EndFunc
#Region Move Windows While 1 Global $aWinList[1][6] = [["Name", "Handle", "PosX", "PosY", "Width", "Heigth"]] GetPos()
;~ _ArrayDisplay($aWinList) ;~ _ArrayDisplay($aWinListOld1) If $pause = 0 Then If $sSLSmode = 0 Then If $aWinList[UBound($aWinList)-1][2] >= 0 Then ;Is in SLS Mode ToolTip("Waiting"&@CRLF&"Bezelcorrection: "&$sBezelcorrection&@CRLF&"Desktop: "&$aWinList[UBound($aWinList)-1][4],@DesktopWidth/2, @DesktopHeight/2,"Switching to SLS Mode",1, 2) $sSLSmode = 1 $aWinList=$aWinListOld1 Sleep($sDelayS) SwitchToEF() EndIf ElseIf $sSLSmode = 1 Then If $aWinList[UBound($aWinList)-1][2] < 0 Then ;Is in Extended Mode $sSLSmode = 0 $aWinList=$aWinListOld1 ToolTip("Waiting"&@CRLF&"Bezelcorrection: "&$sBezelcorrection&@CRLF&"Desktop: "&$aWinList[UBound($aWinList)-1][4],@DesktopWidth/2, @DesktopHeight/2,"Switching to Single Mode",1, 2) Sleep($sDelayE) SwitchToSingle() EndIf EndIf Else EndIf
Local $aList = WinList() For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then $aPos=WinGetPos($aList[$i][1]) ;~ _ArrayDisplay($aPos) If $aPos[0] <> "-32000" Then _ArrayAdd($aWinList, $aList[$i][0]) $aWinList[$iarray][1] = $aList[$i][1] $aWinList[$iarray][2] = $aPos[0] $aWinList[$iarray][3] = $aPos[1] $aWinList[$iarray][4] = $aPos[2] $aWinList[$iarray][5] = $aPos[3] $iarray= $iarray+1 EndIf ;~ _ArrayDisplay($aWinList) EndIf Next
EndFunc
Func SwitchToEF() $iSEF =1 _ArrayDelete($aWinList, UBound($aWinList)-1) Do ;Check if windows are moveable, take last window WinMove($aWinList[UBound($aWinList)-1][1], "", ($aWinList[UBound($aWinList)-1][2])+1, $aWinList[UBound($aWinList)-1][3]) Sleep(100) $aPosCheck = WinGetPos($aWinList[UBound($aWinList)-1][1]) ConsoleWrite('Window: '&$aWinList[UBound($aWinList)-1][1]&' posold: '&$aWinList[UBound($aWinList)-1][2]&@CRLF) Sleep(200) Until $aPosCheck[0] = ($aWinList[UBound($aWinList)-1][2])+1 ; END Check
ToolTip("Moving",@DesktopWidth/2, @DesktopHeight/2,"Switching to SLS Mode",1, 2) Do If $aWinList[$iSEF][2] <= 0 Then WinMove($aWinList[$iSEF][1], "", ($aWinList[$iSEF][2])+$sXwidth, $aWinList[$iSEF][3]) ElseIf $aWinList[$iSEF][2] > 0 And $aWinList[$iSEF][2] < $sXwidth Then WinMove($aWinList[$iSEF][1], "", ($aWinList[$iSEF][2])+$sXwidth+$sBezelcorrection, $aWinList[$iSEF][3]) ElseIf $aWinList[$iSEF][2] >= $sXwidth Then WinMove($aWinList[$iSEF][1], "", ($aWinList[$iSEF][2])+$sXwidth+($sBezelcorrection*2), $aWinList[$iSEF][3]) EndIf $iSEF = $iSEF+1 Until $iSEF >= UBound($aWinList) ToolTip("Done",@DesktopWidth/2, @DesktopHeight/2,"Switching to SLS Mode",1, 2) Sleep(500) ToolTip("") EndFunc
Func SwitchToSingle() _ArrayDelete($aWinList, UBound($aWinList)-1) $iSS =1 Do ;Check if windows are moveable, Take first Window WinMove($aWinList[$iSS][1], "", ($aWinList[$iSS][2])-1, $aWinList[$iSS][3]) Sleep(100) $aPosCheck = WinGetPos($aWinList[$iSS][1]) Sleep(200) Until $aPosCheck[0] = ($aWinList[$iSS][2])-1 ;End Check
ToolTip("Moving",@DesktopWidth/2, @DesktopHeight/2,"Switching to Single Mode",1, 2) Do If $aWinList[$iSS][2] < $sXwidth Then WinMove($aWinList[$iSS][1], "", ($aWinList[$iSS][2])-$sXwidth, $aWinList[$iSS][3]) ElseIf $aWinList[$iSS][2] >= $sXwidth+$sBezelcorrection And $aWinList[$iSS][2] <= $sXwidth+$sXwidth+($sBezelcorrection*2) Then WinMove($aWinList[$iSS][1], "", ($aWinList[$iSS][2])-($sXwidth+$sBezelcorrection), $aWinList[$iSS][3]) ElseIf $aWinList[$iSS][2] >= $sXwidth+$sXwidth+$sBezelcorrection+$sBezelcorrection Then WinMove($aWinList[$iSS][1], "", ($aWinList[$iSS][2])-($sXwidth+$sBezelcorrection*2), $aWinList[$iSS][3]) Endif $iSS = $iSS+1 Until $iSS >= UBound($aWinList) ToolTip("Done",@DesktopWidth/2, @DesktopHeight/2,"Switching to Single Mode",1, 2) Sleep(500) ToolTip("")
Cool, well done. Guess this language could also be used to spread a windowed game. I am having a problem in Win10 with some windowed games, not spreading full (i.e. ShiftWindow is blocked from spreading full). Do you think AutoIT script might work in such a case? (I am looking for potential workarounds atm)
The only way to know is to try. I've had some problems to resize Dx Windows with AutoIT if I couldn't resize them with the mouse in the past, but that's just my memory. Might be wrong or might be working better now
Will keep this in mind, thanks Haldi. It sounds promising... EDIT: It worked! Used WinMove. Perfect short-term workaround for Win10-problem-games.
(How it works out: Win10 shrinks the window size to a bit below "full spread," just like ShiftWindow. But if game resolution is set previously, & resolution is not passed to WinMove, then Win10 doesn't shrink the window. Gives perfect borderless spread).
v1.0.2 is now ready. Added a GUI which supports all resolutions and Bezel correction.
By pressing Save Settings you will create a AutoWindowsMoverSettings.ini file which is stored in the script directory and saves settings after a reboot.
Added a Tray icon for opening Settings, pausing the script and Exiting
Pausing will still remember windows position but will NOT move them.
Could be easily done with a shellexecute call or something. A button for custom commands /run exes on switches and then define the whole command in the .ini file. One for switching forth and one for switching back.
I'm currently in holidays and don't have a computer with me, so I can't do it right now, if somebody else wants to take over, np.
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum