Você pode fazer isso com o PowerShell. Primeiro crie um script Powershell chamado "MoveScreens.ps1" e copie e cole o seguinte código em:
Function Set-ScreenPosition {
param (
[Parameter(Mandatory=$true,
Position = 0)]
[int]
$x,
[Parameter(Mandatory=$true,
Position = 1)]
[int]
$y
)
$pinvokeCode = @"
using System;
using System.Runtime.InteropServices;
namespace Mover
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct DEVMODE
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public int dmPositionX;
public int dmPositionY;
public int dmDisplayOrientation;
public int dmDisplayFixedOutput;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string dmFormName;
public short dmLogPixels;
public short dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
};
public class NativeMethods
{
// PInvoke declaration for EnumDisplaySettings Win32 API
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int EnumDisplaySettings(string lpszDeviceName, int iModeNum, ref DEVMODE lpDevMode);
// PInvoke declaration for ChangeDisplaySettings Win32 API
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int ChangeDisplaySettings(ref DEVMODE lpDevMode, int dwFlags);
// constants
public const int ENUM_CURRENT_SETTINGS = -1;
public const int CDS_UPDATEREGISTRY = 0x01;
public const int CDS_TEST = 0x02;
public const int DISP_CHANGE_SUCCESSFUL = 0;
public const int DISP_CHANGE_RESTART = 1;
public const int DISP_CHANGE_FAILED = -1;
public static DEVMODE CreateDevmode()
{
DEVMODE dm = new DEVMODE();
dm.dmDeviceName = new String(new char[32]);
dm.dmFormName = new String(new char[32]);
dm.dmSize = (short)Marshal.SizeOf(dm);
return dm;
}
}
public class PrimaryScreenPosition
{
static public string ChangePosition(int x, int y)
{
DEVMODE dm = CreateDevmode();
if (0 != NativeMethods.EnumDisplaySettings(@"\.\DISPLAY1", NativeMethods.ENUM_CURRENT_SETTINGS, ref dm))
{
dm.dmPositionX = x;
dm.dmPositionY = y;
int iRet = NativeMethods.ChangeDisplaySettings(ref dm, NativeMethods.CDS_TEST);
if (iRet == NativeMethods.DISP_CHANGE_FAILED)
{
return "Unable To Process Your Request. Sorry For This Inconvenience.";
}
else
{
iRet = NativeMethods.ChangeDisplaySettings(ref dm, 0);
switch (iRet)
{
case NativeMethods.DISP_CHANGE_SUCCESSFUL:
{
return "Success";
}
case NativeMethods.DISP_CHANGE_RESTART:
{
return "You Need To Reboot For The Change To Happen.\n If You Feel Any Problem After Rebooting Your Machine\nThen Try To Change Resolution In Safe Mode.";
}
default:
{
return "Failed To Change The Position";
}
}
}
}
else
{
return "Failed To Change The Position.";
}
}
private static DEVMODE1 GetDevMode1()
{
DEVMODE1 dm = new DEVMODE1();
dm.dmDeviceName = new String(new char[32]);
dm.dmFormName = new String(new char[32]);
dm.dmSize = (short)Marshal.SizeOf(dm);
return dm;
}
}
}
"@
Add-Type $pinvokeCode -ErrorAction SilentlyContinue
[Resolution.PrmaryScreenPosition]::ChangePosition($x,$y)
}
Em seguida, crie outro script para executar o acima como assim (os números são a largura e a altura da sua segunda tela, e obviamente você precisará atualizar o caminho para onde quer que você coloque o primeiro script!):
.\C:\Temp\MoveScreeens.ps1
Set-ScreenPosition 1920 1080
Você só precisa executar o segundo script e ele deve empilhar as telas para você, com o principal na parte inferior.
Ressalva: Isso pode não funcionar dependendo das configurações da Execução de script na máquina. Se você tiver problemas, execute o script com a configuração apropriada ativada:
PowerShell.exe -ExecutionPolicy Bypass -File .\MoveScreens_Stack.ps1
Outra ressalva: Esse script pressupõe que os monitores são organizados horizontalmente, com o mostrador esquerdo em # 1. Se eles estiverem em um arranjo diferente (por exemplo, já em um arranjo vertical), a estranheza provavelmente ocorrerá!