Multi-Monitor Screen Switching

Asked 2 years ago, Updated 2 years ago, 39 views

Connect a graphics board with four monitors to your Windows 10 PC and
I would like to create an application that switches the output status of the screen.
You can play videos and more by treating four monitors as a single monitor.
I would like to play images and videos independently of each of the four monitors.

I thought I should call a DisplaySwitch that Windows has as a standard.
It didn't seem to be able to display it as a single monitor.

In some C#, C++, Java, etc. built-in method,

If you know how to switch between multi-display screen output methods
Could you please let me know?

java c# c++ windows

2022-09-30 19:04

1 Answers

The idea is not to switch between monitors and screen output methods, but to move the position and size of the window to the area that each monitor is responsible for.

Here is how to retrieve information in C++:
[High DPI] How do I get a physical coordinate system for my desktop?[WinAPI]

Desktop rectangles include virtual desktop rectangles and regular desktop rectangles.

Desktop Rectangle per Monitor  Desktop rectangle per monitor.
 There are also monitor rectangles and work rectangles (rectangles excluding taskbar areas).

Virtual Desktop Rectangle  A virtual desktop rectangle containing all monitors in use.

Based on the above information, you can specify and change the position and size of the window in SetWindowPos.
SetWindowPos function

The moving sample will probably be as follows.
Get coordinates for each display on multiple displays

As mentioned in the above example, DPIs and multi-monitors of different sizes should also be considered.
(Windows 10)Multi-display environments for high and normal DPIs are pretty tough
Introducing the new features of Hidemaru Editor (Per-Monitor DPI ready)


2022-09-30 19:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.