Matthew van Eerde's web log

  • Matthew van Eerde's web log

    Windows Sound test team rowing morale event


    Last Friday the Windows Sound test team went kayaking.  We went to the Agua Verde paddle club and kayaked around Union Bay for a while.

    Here's the route we took:


    More detail:


  • Matthew van Eerde's web log

    Programmatically rearranging displays


    Most of my test machines and my laptop have a single display; but I have two dev machines which are each connected to two displays.

    When I clean install Windows, I sometimes need to rearrange the displays:

    Since I clean install Windows frequently, I wrote myself a little C++ app which does this programmatically using EnumDisplayDevices / EnumDisplaySettings / ChangeDisplaySettingsEx.

    Source and binaries attached.


    for (each device returned by EnumDisplayDevices) {

       grab the position and the height/width using EnumDisplaySettings


    calculate the desired position of the secondary monitor

    Set it using ChangeDisplaySettingsEx with DM_POSITION


    Call as:

    Moved secondary monitor to (1920, 0)

    EDIT: Oops: 0 should be CDS_GLOBAL | CDS_UPDATEREGISTRY, to make the settings apply to all users, and to persist across display resets / reboots

    LONG status = ChangeDisplaySettingsEx(
        nullptr, // reserved
        nullptr // no video parameter

    EDIT September 22 2015: moved source to github

Page 1 of 1 (2 items)

May, 2012