Code to change from Mirror Dual Display to Extended

2 posts in this topic

Hi I am writing a program to automate many things. In that program I want to switch from dual screen mirror mode to dual screen extend mode or from a dual screen extend mode back to mirror mode with a hotkey.

 I was wondering if someone can help me out with the code to do this.  I have seen examples online in my search on how to determine whether the computer is in single monitor mode or dual monitor mode but I found nothing on how to make the change happen with code only. Thanks for the help.

Share this post

Link to post
Share on other sites

Does this help? 

HotKeySet("{F1}", "ExtendDisplay")
HotKeySet("{F2}", "Secondmonitor")
HotKeySet("{F3}", "ComputersMonitor")
HotKeySet("{F4}", "DuplicateDisplay")

While 1

Func ExtendDisplay()
    Run("DisplaySwitch.exe /extend")

Func Secondmonitor()
    Run("DisplaySwitch.exe /external")

Func ComputersMonitor()
    Run("DisplaySwitch.exe /internal")

Func DuplicateDisplay()
    Run("DisplaySwitch.exe /clone")


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now