Iconifying a window:

Alt-Click close (or other iconification trigger).
Wimp broadcasts 'window wants to be iconified' (including window title text strncpyed to fill the event block)
Iconification app not there:
        Nothing more happens
Iconification app is there:
        It does Ack the message (stops fights between multiple iconification apps)
        It send an iconification request to the window being iconified
        (Old style) app ignores the message it doesn't understand:
                Iconification app gets message_acknowledge back
                Iconification app sends open window request for window, behind window -3 (at back, and I really mean this! - there has to be at least one full sized back window)
                Iconification app creates iconified window entry somewhere (using app title and window title)
                App receives open request and, hopefully, sends it through cleanly.
        (New style) app picks up iconify request
                (i) App wishes to help the iconify app, but doesn't want to mess about itself.
                        App returns message giving more accurate details for iconification (a sprite and some text)
                        Iconification app sends open window request behind -3
                        Iconification app adds iconified entry
                        App opens window like a good little boy.
                (ii) App does want to mess about iconifying its own windows.
                        App Acks the message
                        Iconification app doesn't get any returned message and does nothing more.
                        App does all messing about iconifying the window.


Iconified window is clicked upon to de-iconify it.
Iconification app sends OpenRequest to app.


App opens iconified window
Window opens as requested. If window suddenly appears; sad.


App closes or deletes iconified window
Wimp broadcasts 'window closed' message as if it was sent from app.
Iconification app disposes of iconified window's entry.


App dies:
Close window broadcasts don't get sent, but
Application dying broadcast gets sent
Iconification app junks iconify entries for that app's windows.


In summary:
Close window broadcasts get sent on:
Application closing a window (Wimp_CloseWindow)
Application deleting a window (Wimp_DeleteWindow)
