The source code of the screenshot program is available everywhere on the Internet, but it basically does not support multiple monitors.
At one time, I thought it was very difficult to support multiple monitors.
(Demo http://download.csdn.net/detail/problc/3841959 contains multi-display support, window highlighting, cross amplification, etc)
In fact, the multi-display screenshots are not very different from the screenshots of the primary monitor, and even do not require calls such as EnumDisplayMonitors. It's just because the source code is available on the internet that we don't bother thinking about.
1. DC problems.
HScrDC = CreateDC (_ T ("DISPLAY"), NULL); // main DISPLAY DC
HScrDC =: GetDC (getshorttopwindow (); // multi-screen DC
2. Coordinate issues.
Use the VIRTUALSCREEN parameter to obtain coordinates.
GetSystemMetrics (SM_CXVIRTUALSCREEN );
GetSystemMetrics (SM_CYVIRTUALSCREEN );
GetSystemMetrics (SM_XVIRTUALSCREEN );
GetSystemMetrics (SM_YVIRTUALSCREEN );
Note that SM_XVIRTUALSCREEN and SM_YVIRTUALSCREEN can be negative values for multiple monitors.
Therefore, do not consider the boundary as (0, 0)-> (cx, cy) when processing multiple monitors ).
The coordinates of multiple monitors are (0, 0) in the upper left corner of the main screen ).
If you have the source code for a single monitor, you may wish to change the above several small places, you will find that multi-screen screenshots are actually very easy.
From the column of problc