WindowsFormsParkingWindow

October 3rd, 2005

I recently had to deal with a truly delightful bug in a Winforms app I was working on: Immediately after being clicked on, the main window would become deactivated. As my last step before calling in an exorcist, I logged WM_ACTIVATE to see if I could find the identity of the form that was being activated when this happened. Turns out I was being hijacked by something called the WindowsFormsParkingWindow.

The WindowsFormsParkingWindow is an orphanage for unwanted Child Controls. When you remove a Control from your form, it gets….er…parked on the WindowFormsParkingWindow. Evidently, if the removed control has focus when this happens, you’ve got a problem because the WindowsFormsParkingWindow, i.e. the Invisible, Modal (!) WindowsFormsParkingWindow, will now become active in a way nature never intended.

To avoid this, make sure you do not remove a child control while it has focus.

2 Responses to “WindowsFormsParkingWindow”

  1. Damien Morton Says:

    No WindowsFormsParkingTicket?

  2. Sandy Says:

    Every time i log off a window comes up that says
    “WindowFormsParkingWindow”
    I don’t know what the problem is or how to correct it, any suggestions?