Change Main Display in Windows 10  

Page 6 of 6 FirstFirst ... 456

  1. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #50

    KittyMeck said:
    Well, restarting the graphics driver didn't make any dual-monitor controls appear when only one monitor is connected. But it did replace the blank screen on the monitor with a duplicate of the desktop when I connect the HDMI cable. But there are no desktop icons, and if I open Settings, it doesn't display; presumably it's on the TV. Again, there are NO "presentation mode" or primary/secondary display controls with only the one monitor connected, and the Settings dialog isn't displayed on the monitor if the TV is connected. I notice that Microsoft carefully made sure that there's no keyboard shortcut for the "Detect" button either, so I can't display the Settings dialog, plug the TV in and select "Detect" blind.
    As a test, what happens when both displays are connected and you set project to "PC screen only"?

    If you are not able to set this using the above method with Win+P, then you could add the context menu below to use it instead.

    Add Project Display context menu in Windows 10

    When you open Settings, do see its icon on the taskbar at the bottom despite not showing on the display?

    If you do, then you see if you may be able to drag the Settings window back onscreen using an option below.

    Move Off-Screen Window back On-Screen in Windows 10
      My Computers


  2. Posts : 1
    Windows 10
       #51

    It doesn't even work on the latest version of Windows 10 of May 9th, 2020. I can't do it. I could in 2019 but I cant find what I need.
      My Computer


  3. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #52

    LateUser430 said:
    It doesn't even work on the latest version of Windows 10 of May 9th, 2020. I can't do it. I could in 2019 but I cant find what I need.
    Hello LateUser430, and welcome to Ten Forums.

    Please provide more details and screenshots about your issue and what's not working to see what we can do to help.,
      My Computers


  4. Posts : 2
    Windows 10 64-bit
       #53

    Not saving main display


    I have an Alienware m15 (R1) laptop with 3 additional displays in my office. I like the centre top display to be my main display as it is the largest screen. However, when I restart the laptop, the main display reverts back to the laptop's screen (even when booted with all the screens plugged in - as I always do). The attached image shows the entire desktop immediately after boot with the Display Settings window open. You can see that display 2 is set as the main display, but display 1 has the notification area in its taskbar so is the main display.
    Change Main Display in Windows 10-main-display-not-main-display.png
    If I change the main display to display 1 and back to display 2 all is good until the next reboot. I have a similar setup at my home which does not have the same issue. I already deleted all configurations in the registry to try to fix this, but it did not (I now only have 2 configurations in the registry: one for home and one for work). I have looked online and cannot find how to sort this. I am open to using Powershell, command prompt or Python to programmatically set the main display after booting if required.
      My Computer


  5. Posts : 2
    Windows 10 64-bit
       #54

    Python saves the day!


    I found the solution on another web site and modified it to suit my setup. I'm not sure if I can provide a link to another site, so I won't. I use Python 3.7.6.

    Code:
    import win32api as w
    import win32con as c
    
    def load_device_list():
        """loads all Monitor which are plugged into the pc
        The list is needed to use setPrimary
        """
        workingDevices = []
        i = 0
        while True:
            try:
                Device = w.EnumDisplayDevices(None, i, 0)
                if Device.StateFlags & c.DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: #Attached to desktop
                    workingDevices.append(Device)
    
                i += 1
            except:
                return workingDevices
    
    
    def setPrimary(id, workingDevices, MonitorPositions):
        """
        param id: index in the workingDevices list.
                  Designates which display should be the new primary one
    
        param workingDevices: List of Monitors returned by load_device_list()
    
        param MonitorPositions: dictionary of form {id: (x_position, y_position)}
                                specifies the monitor positions
    
        """
    
        FlagForPrimary = c.CDS_SET_PRIMARY | c.CDS_UPDATEREGISTRY | c.CDS_NORESET
        FlagForSec = c.CDS_UPDATEREGISTRY | c.CDS_NORESET
        offset_X = - MonitorPositions[id][0]
        offset_Y = - MonitorPositions[id][1]
        numDevs = len(workingDevices)
    
        #get devmodes, correct positions, and update registry
        for i in range(numDevs):
            devmode = w.EnumDisplaySettings(workingDevices[i].DeviceName, c.ENUM_CURRENT_SETTINGS)
            devmode.Position_x = MonitorPositions[i][0] + offset_X
            devmode.Position_y = MonitorPositions[i][1] + offset_Y
            if(w.ChangeDisplaySettingsEx(workingDevices[i].DeviceName, devmode, 
                FlagForSec if i != id else FlagForPrimary) \
                != c.DISP_CHANGE_SUCCESSFUL): return False
    
        #apply Registry updates once all settings are complete
        return w.ChangeDisplaySettingsEx() == c.DISP_CHANGE_SUCCESSFUL;
    
    if(__name__ == "__main__"):
        devices = load_device_list()
        for dev in devices:
            print("Name: ", dev.DeviceName)
    
        monitor_positions_work = {
            0: (0, 1080),
            1: (0, 0),
            2: (-1920, 0),
            3: (1920, 0)
        }
    
        setPrimary(1, devices, monitor_positions_work)
    The win32api library will need to be added by running in cmd:
    Code:
    pip install pypiwin32
      My Computer


 

Tutorial Categories

Change Main Display in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:23.
Find Us




Windows 10 Forums