Pplu wonders why programs run more slowly when the system is running with multiple monitors.

Well, for one thing, of course, when you have more than one monitor, there's more stuff on the screen for the system to keep track of. It's the same reason that programs run more slowly on a large monitor than on a small monitor.

And if there's only one monitor, then functions like MonitorFromPoint become trivial if the flag is something like MONITOR_DEFAULTTONEAREST, because when there's only one monitor, answering questions like "What monitor is closest to this point"? becomes very easy.

If your two monitors are not the same dimensions, then the union of the two monitors will not be rectangular, which makes clipping against the union of all monitors more complicated.

But I suspect the big penalty for multiple monitors kicks in if you make the mistake of setting your monitors to different color formats, for example, if you set one monitor to 565 format and set another to 24bpp.

If the two monitors do not use the same color format, then programs will be forced to use DIBs instead of DDBs for screen bitmaps, in case a window is moved to a window with a different color format (or worse, is positioned so it straddles two monitors with different color formats). In principle, programs need only use the "worst-case" DIB; for example, if one monitor is 555 and the other is 565, then a 565 DIB will suffice. In practice, however, most programs just fall back to a 24bpp or 32bpp DIB when faced with monitors with different color formats.

(You query whether all monitors have the same color format by calling GetSystemMetrics(SM_SAMEDISPLAYFORMAT).)

Since a format conversion takes place when a DIB is blitted to a device with a different color format, forcing a program to retain its bitmaps as DIBs means that for at least one of the monitors (and probably both), you're going to undergo a format conversion when that DIB is drawn to the screen. There are also a few miscellaneous optimizations which are disabled when not all your monitors use the same color format because the cost of using DIBs outweighs the savings from the optimization.

So if you haven't already, go into your display settings and check that you set all your monitors to the same color depth. If you don't do this, then a large class of graphics optimizations is lost.