Does anyone know how to programatically change the main display in Windows 10? I have 4 displays including the laptop's own, but when I restart the laptop the main display changes back to the laptop's display instead of the larger monitor I had set as the main display previously. I have given up trying to figure out why it does this, as it even says in the Display Settings that the larger monitor is the main display when it isn't - so I change it to the laptop display and back to the larger monitor each time I restart, which is annoying. If I could figure out how to change it by using a command prompt command, Powershell command or using Python code I would be content. 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.
Related
I use three screens on my windows 10 desktop. The main screen is 1920x1200. My laptop has 1920x1080 on its only screen. I remote control my desktop from my laptop, and I change the display settings to disable the two other screens and set the resolution of my main screen to match that of my laptop. It's somewhat tedious to change those settings, so I am looking for a way to change my display settings all at once.
Essentially I wish to have two profiles: 1 for regular use, and 2 for remote control. As far as I have researched, one cannot change display settings in windows 10 from the command line, so a simple bat file is not possible.
What is a way of achieving this switch with as few clicks as possible?
Maybe you could use PowerShell with the cmdlet Set-DisplayResolution.
The documentation about this cmdlet you can find here
Is there a way to temporarily disable the display during a Windows 10 PC restart?
Background: we have a software, which is set to start up automatically after a PC restart. Upon startup (after Windows has booted) this software starts in a console window and then opens a WPF screen, which is displayed fullscreen and always resides in front of everything else. I would like to black out the screen ideally as early as possible during the Windows startup up to the point in time when our software WPF window is set and ready on the screen. This way the console window (as well as the desktop showing for a short period of time) would be hidden from the user.
In an ideal world I would hide the fact that Windows is running on the PC from the user, but I assume this is not possible over a restart...
Is this possible with the help of registry settings/command line tools/batch file commands or similar?
I try to grab specific windows on Windows 10. I read some articles from MSDN to get familiar with APIs. My goal is to grab some certain windows, even if there are some windows on top of them (equivalent to OS X CGWindowList API). So if there are 2 windows: A and B, and windows B partially overlaps window A, I would like to be able to capture window A content, without capturing window B that partially covers window it.
According to this link, there are 5 different ways to capture the screen, if I understood them correct, most of them can capture only some regions on the screen, i.e. they don't distinguish between windows. The only API which allows to grab specific windows is "old standby, GDI".
I tried to acquire windows' device contexts using GetWindowDC() function, create a compatible bitmap and then use bit block transfer (BitBlt()). However, it seems that it does not always work as expected.
I've noticed several problems on Windows 10 (did not test on other operating systems):
Window's title bar usually is not captured. I tried to open Notepad and capture the window, but it was not fully captured, part of the scroll bar was not captured as well as a title bar. I tried to capture child windows of Notepad, but it did not work as expected, moreover some child windows are seem to have coordinates which seem to be wrong (the msctls_statusbar32msctls_statusbar32 child window of Notepad had the width which was 3 times bigger than the actual width of the window).
Some apps are not captured at all. For instance applications like "Photos", "Calc", "Settings" are not captured with that approach, when I try to capture them I get a black bitmap. There should be an API which allows capturing such windows, for instance TeamViewer is able to capture those Windows. It seems that all such windows are rendered by ApplicationFrameHost.exe process.
Does anyone know how to solve those issues?
When you go into screen resolution control panel in windows 7 the monitors are listed with numbers and there is an identify button that causes the ID's to show up on both displays.
Is there a way to get at this via the win32 API?
I am trying to write a program that gets the windows that are displayed on the screen. Something like screen.getActiveWindow().size would be cool, but it only addresses the active window.
I am looking for the sizes of all windows on the screen, as well as event information when they are resized, cover each other up.
Am I just daydreaming or is there a way to get this information on windows?
You need to use EnumWindow Function go get the hwnd of each window then user EnumChildWindow to get the child windows and finally get windowinfo the clr doesn't have all of the necessary function to do low level window manipulation unless its been added in 4.0 and I haven't noticed.