3 ms·
That's an interesting and creative theory. I have to admire your putting so much detailed thought into it! I mean this sincerely. Perhaps parts of the Windows
by Stratoscope 6y ago
That's an interesting and creative theory. I have to admire your putting so much detailed thought into it! I mean this sincerely.
Perhaps parts of the Windows 1.0 GUI could have been implemented like that, but the truth is much simpler and more mundane.
The bundled apps (including MS-DOS Executive) and the window decorations generally used the same GDI (Graphics Device Interface) calls as third party apps:
Text was drawn with TextOut() or DrawText().
Bitmaps were copied to the framebuffer with BitBlt() or StretchBlt().
Lines were drawn with MoveTo() and LineTo().
Rectangles were drawn with Rectangle() or RoundRect().
This is not an exhaustive list but should give you the general idea.
All of these functions operated on a "device context" (DC) that you obtained with functions like GetDC() or CreateCompatibleDC(). Some, like BitBlt(), used two DCs for the source and destination.
The MS-DOS Executive drive icons were bitmaps drawn with BitBlt() with TextOut() for the drive letter. The selected drive letter and icon were inverted with InvertRect(), or possibly drawn with the DSTINVERT raster operation code.
These are the same functions that any Windows application could use. The MS-DOS Executive was just another app.
The non-client area of a window (titlebar and such) was drawn with the same GDI calls as the client area. Your app would get a WM_PAINT message to draw the client area and a WM_NCPAINT for the non-client area. Most apps passed WM_NCPAINT through to the default handler DefWindowProc().
I was programming Windows apps starting with the first release of Windows 1.0. I spent a fair amount of time reverse engineering other Windows apps and Windows itself, along with people like Matt Pietrek and Andrew Schulman.
Andrew in particular would have devoted an entire chapter of his book Undocumented Windows to the text-based system you describe. It would be a field day for him!
Also consider memory limitations and programmer time. Remember that Windows 1.0 ran (slowly) on a machine with 256KB memory and two floppy drives.
Since they had to build GDI anyway, it would take more memory to also include this text-based system. It also would have taken more developer time, and provided less testing of the public APIs.
But again I do appreciate your interesting speculation!