• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

How to arrange monitor display order?

Joined
5/2/06
Messages
11,768
Points
273
Say I have 3 monitors numbered 1,2,3. The original display order from left to right is 1 -> 2 -> 3.
To rearrange it, I can just drag any monitor and move them around. Anyone knows if I can rearrange them only using keyboard, tabs, etc.

I'm writing a script and it only involves key strokes, not mouse events. for the most part, it did what I want but I couldn't find out how to rearrange the monitor order with keystrokes.

Ideas, thoughts?
 
is this windows? Linux? OS X? It's still not very clear to me what you want to do.
 
Ok, I was able to move the monitors around in the Settings windows with the keyboard. It is kind of quirky but seems to do the trick. The only problem is that I don't get the desired effect on my machine, not even dragging the monitors with the mouse.

I'm assuming that you know how to get the the display Settings using the Keyboard in XP. After you are in that window, you can select the display you want to move by pressing the given number (1, 2, etc). Then, you just need to start using the cursor keys. You will notice right away what you need to do.
 
Ok, I'll tell you why I want to do this and probably some of your had or will encounter this at some point on a trading desk.
Usually, most people on a trading desk have 3 or 4 monitors. Some will want to connect to the work station from home via VPN, remote connect to trade after market. This is specially true for people who trade the Asian or European market.
Issue: the problem is that you have to remember to disable all the extra monitor displays before you go home so that you only have one primary display. If you forget, remote connect from home will not scale correctly. It's like trying to look at 42" screen via a 14" screen. You have to move and drag thing around. It's really annoying if you work long hour from home.
Even if you remember to do it before leaving work, it's a chore and prone to messing your monitor settings.
Workaround: remember to manually disable the damn extra monitors.
OR
I found a program called AutoIt which I can program to do the automatic monitor switching for me. I wrote some script, make an exe, put a shortcut on the taskbar. Click once, it disables all the extra monitors. Click again, it will enable all. The nice thing is that if i forget to do it, I can still click on it from home and have it remotely set.
I include the script here in case anyone wants to play with it or encounter it in the future. The only issue is that I can't find a way to change the display order using keyboard which can be programmed with AutoIt.
I did ask on the AutoIt forum and nobody seems to know. I hope I use the right tool to do this kind of task. If anyone knows how to do this in a more efficient way, do let me know. This is just one of hundred of things you do at work and if it saves a few minutes each task, the better.

C++:
; exec cpanel app `display settings`
Run("C:\WINDOWS\system32\control.exe desk.cpl,@0,3")

; wait for window to be active
WinWaitActive("Display Properties")

; select 1st display
Send("{TAB}")
Send("{UP}")

; work back to the ‘extend desktop’ controls
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")

; toggle ‘extend desktop’ control and apply
Send("{SPACE}")

;select 3rd display
Send("{TAB}")
Send("{DOWN}")
Send("{TAB}")
Send("{DOWN}")

; work back to the ‘extend desktop’ controls

Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")



; toggle ‘extend desktop’ control and apply
Send("{SPACE}")

Send("{ENTER}")
 
After some hacking at it and some help from the folks at AutoIt, I finally get what I want to do. Here is the code
C++:
;The starting setup is as follow
;Monitor 1 is primary monitor with the display order 1->2->3
;We will enable/disable 2,3 

$file = FileExists (@TempDir & "\run.ini")
if $file = 0 then
    IniWrite(@TempDir & "\run.ini", "section", "runs", "0")
Else
$var = IniRead(@TempDir & "\run.ini", "section", "runs", "default")  


;This is to turn monitors 2 and 3 OFF. 
;Turn monitor 3 OFF first, then 2.

if $var = 0 Then

; exec cpanel app `display settings
Run("C:\WINDOWS\system32\control.exe desk.cpl,@0,3")

; wait for window to be active
WinWaitActive("Display Properties")

; select 3rd display
Send("{3}")



; work back to the ‘extend desktop’ controls
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")

; toggle ‘extend desktop’ control and apply
Send("{SPACE}")


;select 2nd display
Send("{2}")

; work back to the ‘extend desktop’ controls

Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")


; toggle ‘extend desktop’ control and apply
Send("{SPACE}")

Send("{ENTER}")

    IniWrite(@TempDir & "\run.ini", "section", "runs", "1")
    
    
Else

;This is to turn monitors 2 and 3 ON. 
;Turn monitor 2 ON first, then 3.

; exec cpanel app `display settings
Run("C:\WINDOWS\system32\control.exe desk.cpl,@0,3")

; wait for window to be active
WinWaitActive("Display Properties")

; select 2nd display
Send("{2}")



; work back to the ‘extend desktop’ controls
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")

; toggle ‘extend desktop’ control and apply
Send("{SPACE}")


;select 3nd display
Send("{3}")

; work back to the ‘extend desktop’ controls

Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")
Send("+{TAB}")


; toggle ‘extend desktop’ control and apply
Send("{SPACE}")

Send("{ENTER}")


    IniWrite(@TempDir & "\run.ini", "section", "runs", "0")
EndIf
EndIf
 
Back
Top