One of our goals with Windows Forms was to smooth out the weirdness of Win32 as much as we could. And one of the main oddities is window handle control (HWND) and lifetime. We certainly did not want the average user to worry about this. In In most cases, it was pretty easy. You simply collect the entire state, and then when you really need to show the window, you do the creation on demand, then you manage your state from HWND instead of your internal members.
Well, that doesn't always work so well. See, there are certain properties of Win32 windows that you cannot change when a window is created. For example, border style. Thus, in order for the user to change the style of the frame after creating the window, you need to recreate the handle. This means that you need to not only pull everything from the state you want from the existing one, but you need to recreate it and bring it back. Okay, this is not too complicated.
What about the kids? Oh fencing. Children.
If there are children in the window that you change at the border, destroying his pen will destroy the handles of all his children. Then you need to recreate them, which is very expensive. And also a little expensive.
Enter the parking window. The parking window was our solution to this problem. It was somewhere that you could βparkβ the HWND until you got the right parent for them. Think of it as Hunting Aid, but invisible.
So, in the case of creating a descriptor, we would check if every child is there. If this were so, we would (if necessary) create a parking Window, the parent children for this, recreate the parent descriptor, then move them back. It worked very well, although the service life of the parking window caused some problems ...