Oh, thank you for the demonstration. You seem to want 100 screens that will have different Windows array index numbers, regardless of the order in which they were called. This explains the construction of the MakeWindow function.
Obviously you want to have the dialogs drawn in memory so that they do not draw but display directly when needed. You will also direct mouse and keyboard control to that dialog. Good. Wouldn't _PUTIMAGE serve the same goal? Well, I'll be surprised, I don't know exactly where you're going.
The idea is to take this basic concept and then expand upon it. For starters, we can anchor windows to any of our main screens, which we can then swap between as we want. Then let's create an ImageArea, Button, and TextArea and anchor it to that one window...
Now, if the screen is visible (and the window is visible), we draw that window and all its associated objects to the screen...
What it'll end up giving me, when I'm finished with it, is a simple little window system where I can create quick little forms and pop them up and free them, as needed and on call, really quickly.
And I don't really foresee having 100 screens, even though I might have 100 windows which work across half a dozen screens. If I was to import the QB64 IDE into this concept, the main screen would be where your text and all is located. Another screen might be an Option screen, which had 5 or 6 windows anchored to it, completely independent to the main screen, which we make visible/invisible according to which option we selected and wanted to alter. Another screen might be the help screen, which would work the same way...
Just a few screens with various distinct windows anchored to them, which we can then hide/show on demand.
Then with those windows, when they're visible, we anchor objects to them, such as buttons, labels, radial options, image frames, ect...
Mouse and keyboard would respond to which window/options are visible and take precedence. ESCAPE might close the COLOR DIALOG window, or it might try and close the whole IDE itself, if nothing is visible...
Each window would have its own little mouse/keyboard handling routine associated with it, and the window loaded last would take precedence. (Say I have 2 windows which can make use of the ESCAPE key to close them, the one loaded last -- highest Z-Order -- would take precedence over the other.)
I'm just working off the concept that objects anchor off other objects, and only if those other objects are visible, can we draw/interact with them.
Hide a screen, you hide all the objects linked to that screen.
Hide a window, you hide all the objects linked to that window...
In the end, it's just me playing around with a window/layering system for inserting quick forms and popups into one of my projects. ;)