Ownerless and modeless

The editor extension dialog boxes are both ownerless and modeless. Two relationships that can exist between windows are the owner-owned relationship and the parent-child relationship. The owner-owned relationship determines which other windows are automatically destroyed when a window is destroyed. When window A is destroyed, Windows automatically destroys all of the windows owned by A. The parent-child relationship determines where a window can be drawn on the screen. A child window (that is, a window with a parent) is confined to its parent window's client area.

The default window style of an editor extension dialog is WS_POPUP | WS_CAPTION. The dialog is created using a call to CreateWindowEx with hWndParent set to Null. The dialog box is owned by the desktop and not by the IDE. When the dialog box is being owned it would places several constraints on the dialog box.

- An owned window is always above its owner in the Z order.

- The system automatically destroys an owned window when its owner is destroyed.

- An owned window is hidden when its owner is minimized.

By making the dialog box ownerless, these constraints are now removed; there is no relation between the IDE main window and the editor extension dialog boxes. To maintain its visual view the extension must process window messages and handle the appropriate message by its self.

A modeless dialog box does not disable its parent or owner when it is displayed as modal dialog box would. A modal dialog box must be closed before the parent is accessible again. From the fact that the dialog isn't owned it is clear that the dialog box is modeless.

By disabling the IDE window (Gfa_hWnd) you can simulate a modal dialog box. However, when another application is activated and the dialog box is set back in the Z-order it is not very easy to make it visible again. You cannot click on the IDE because it is disabled and the dialog box is not visible in the taskbar. You must minimize other applications before you can access the dialog box again. There is no easy solution to this problem.

{Created by Sjouke Hamstra; Last updated: 12/05/14 by James Gaite}