Most of Windows’ display model is device-independent, or at least provides all the information required to produce consistent displays, and it’s the display drivers that handle discrepancies. As a result, programs look similar regardless of the display’s aspect ratio:
(I’ve scaled these to 4:3, so the images all have the same width and height, but that doesn’t give an accurate representation of how the displays would look on real CGA or EGA monitors.)
When dealing with graphical output, Windows programs use logical coordinates, and those coordinates are mapped to physical coordinates using a configurable mapping. Programs which care about the squareness of squares etc. can request a mapping where logical coordinates correspond to real-world dimensions, e.g. 0.1mm, 0.01mm, 0.01” and so on (although the actual physical result can vary widely, depending on the user’s display adjustments), or even request an “isotropic” mode allowing them to scale their coordinate system as they wish while preserving aspect ratios.
In the screenshots above, note in particular the circles used on the board. The Reversi program only asks Windows to draw circles, and the display driver takes care of actually drawing the circles with whatever horizontal-to-vertical ratio is appropriate. The game board does end up varying in size, because the available display area is different. The CGA and EGA screenshots are of Windows 1.01, with its icon bar at the bottom of the screen; the VGA screenshot is of Windows 2, which gives maximised windows more room (because it eliminated the icon bar, instead allowing icons for minimised windows to appear anywhere on the screen and thus to be covered by windows).
Fonts are provided by display drivers (although they can choose to re-use Windows-provided fonts); if you look at Windows installation disks, you’ll see font files for CGA, EGA, VGA, and possibly 8514/A. This is similar to BIOS support for “plain” text mode (CGA text mode uses 8 vertical pixels per character, EGA uses 14, VGA 16). Many programs use text size as a reference for their general layouts (but users of Windows 3 who tried SVGA modes with the SVGA font probably remember programs which didn’t, and ended up being unusable in that mode; SVGA modes could also be used with VGA fonts, avoiding that problem).
There is one part of the UI that doesn’t adjust: the mouse pointer, which ends up stretched out on EGA and even more so on CGA. Mouse coordinates are always reported as device coordinates.
Icons are device-independent bitmaps, scaled appropriately. In the screenshots above, the icons have approximately the same physical height, even though that requires using a very different number of pixels vertically.
Dialog boxes have a specific coordinate system designed to ensure that their contents remain usable across a variety of outputs (when used properly…).
See the “Introduction to GDI” chapter in Charles Petzold’s Programming Windows for details.