Suppose that you have an add-in that has to review some properties of controls of the forms of a Windows Forms solution using IDesignerHost. To do this:
- The add-in iterates each file of the project (EnvDTE.Project.ProjectItems).
- If the file contains a designer, to get its IDesignerHost using the EnvDTE.Window.Object property it has to get first its EnvDTE.Window. For that, the add-in executes this statement:
EnvDTE.Window win = projectItem.Open(EnvDTE.Constants.vsext_vk_Designer)
At this point the EnvDTE.Window is not visible (to make it visible you would have to call EnvDTE.Window.Visible = True), which is good, because we don't want to make visible each form of the project that we want to review. However, if the IDE was minimized, that statement causes the IDE to be restored, which is undesirable because the user may want the IDE minimized during all the long review operation, and this bug causes the IDE constantly showing up while he is doing other things with other applications.