A modeless action window is preferred in situations where the dialog with the user need not be completed before other user interaction with the application may occur. For instance, in an application object that performs an administrative procedure, data entry would typically be performed by the use of control windows. Since the control windows should remain displayed at all times, their parent window should not be sizable. By definition, the parent window is an optimized window, and should therefore be created as a dialog box. However, it may not be mandatory for the user to complete the dialog before interacting with other windows, and the dialog box should therefore be modeless.
Since the WinDlgBox() function automatically creates and executes a modal dialog box, a modeless dialog box must be created in one of two alternative ways:
The latter method is recommended for reasons of simplicity, since the dialog box and its control windows may be defined and stored in a resource file (see Presentation Manager Resources), making the definition of the dialog box easier for the application developer.
The dialog box may be explicitly positioned on the screen, regardless of the method used. With the former method using the WinCreateWindow() function, the dialog box is positioned at the time it is created. With the latter method, the dialog box is positioned during its processing of the WM_INITDLG message.
The FCF_BORDER attribute results in the dialog box being displayed with a thin blue line as the dialog border. This is in accordance with the SAA CUA guidelines for modeless action windows.
Note that the two methods described above will result in different initialization messages being received. When created with the WinCreateWindow() function, the dialog box is regarded as a "normal" window, and a WM_CREATE message is passed to it. When created with the WinLoadDlg() function however, a WM_INITDLG message is passed instead. The application developer must bear this in mind when creating the dialog procedures for such dialog boxes.