On a dual-monitor system, maximize a window onto one monitor, and then use the Alt+PrtSc hotkey to capture a screen shot of that window. The resulting bitmap captures a few pixels from the adjacent monitor. Why is that?
This is a consequence of a phenomenon I discussed some time ago: Maximized windows actually extend beyond the edges of the monitor. This is done so that the main window body fills the monitor, and the borders hang off the edge. The theory is that you want to fill the screen with the useful parts of the window, and you’re not interested in the borders.
The code that handles the Alt+PrtSc hotkey captures the entire window, including the parts that hang off the monitor. On three of the sides, there is no content on the other side of the monitor, so the attempt to capture those borders fails. But on the fourth side, the screen capture code sees that the pixels are still valid, and it includes them in the bitmap even though they’re on the wrong monitor.
You might be tempted to fix this by clipping the screen shot to the current monitor, but that would result in partial screen shots in the case where the user has a window that intentionally straddles more than one monitor.
0 comments