baraider Posted January 28, 2008 Share Posted January 28, 2008 First, thanks very much for this wonderful program. I've been trying to write some code in vba/C# to do the samething. So happy to find this program.I saw a script that will toggle on/off the extension for second monitor. I have 3 monitors and I want to toggle on/off extend monitor 1 and 3 while monitor 2 (the center one) is primary.Is there something about TAB I need to learn because the number of TAB in the script and the number you do manually are not identical in some case.I'd like to have an general idea so in the future I want to keep monitor 1 primary, and turn on/off extend monitor 2,3 for example.; exec cpanel app `display settings`Run("C:\WINDOWS\system32\control.exe desk.cpl,@0,3"); wait for window to be activeWinWaitActive("Display Properties"); select 2nd displaySend("{TAB}")Send("{DOWN}"); work back to the extend desktop controlsSend("+{TAB}")Send("+{TAB}")Send("+{TAB}")Send("+{TAB}")Send("+{TAB}")Send("+{TAB}")Send("+{TAB}"); toggle extend desktop control and applySend("{SPACE}");select 3rd display;Send("{TAB}");Send("{DOWN}")Send("{ENTER}") Link to comment Share on other sites More sharing options...
baraider Posted February 1, 2008 Author Share Posted February 1, 2008 I was able to get this to work using the following code. A problem I still have is that when i select/deselect to extend monitor 1 and 3, the monitor arrangement changes. I have it's in 1 - 2 - 3 order and when I choose to deselect 1,3, the monitor arrangement is 2 -1 -3. Anyone know if I can use any key shortcuts to toogle them back at the end of my script ? expandcollapse popup; 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}") Link to comment Share on other sites More sharing options...
baraider Posted April 24, 2008 Author Share Posted April 24, 2008 It's been 3 months and I wonder if anyone has any hints for me? tks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now