I want a hotkey to move windows to a specific monitor, specifically my "LG HDR 4K" monitor, as it is displayed in Windows. The problem is that I have only figured out to do this using monitor indexes, and every time I unplug or re-plug in the monitors, the indexes seem to jump around.
I was hoping I could do it by name, rather than an index, so I tried this:
Code: Select all
SysGet, MonitorCount, MonitorCount
Loop, %MonitorCount%
{
SysGet, MonitorName, MonitorName, %A_Index%
MsgBox, Monitor %A_Index%: %MonitorName%
}
But the monitor names aren't helpful; they are "\\.\DISPLAY1", ""\\.\DISPLAY2", ""\\.\DISPLAY3", etc. I assume those indexes will also change when I unplug the monitors and everything.
How can I tell authotkey to move a window specifically to the "LG HDR 4K" monitor, even as I plug in new monitors or unplug other monitors arbitrarily?