Application-Defined Dialog Boxes

An application-defined dialog box is a child window that you design to suit the needs of your application. You can use any format for a dialog box; in addition, you can use any kind of control in a dialog box. The following screen shot shows an application-defined dialog box.

In Windows CE, all dialog boxes are control parents. They are also recursive. This means that if a dialog box has a child dialog box when a user tabs through the parent dialog box, the dialog box manager tabs into the child dialog box as well. If a dialog box is outside the visible area of the screen, Windows CE does not automatically reposition it.

If a user presses ALT+H while the dialog box has the input focus, the system posts a WM_HELP message to the dialog box procedure. Respond to this message by displaying context-sensitive Help for the dialog box.

Sometimes it is necessary for a dialog box to appear on top of all other windows. For example, under low memory conditions, the System Out of Memory dialog box will send a WM_CLOSE message to an application. If the application is not in the foreground, any dialog box it displays will be hidden behind the current foreground window unless you create the dialog box with the DS_SETFOREGROUND style. Because putting the dialog box in the foreground will not bring the application's main window forward, put in the dialog box any information that a user might need to decide what action to take.

In Windows CE, dialog boxes have the WS_POPUP style by default. If you want to use the WS_CHILD style, specify it in the style member of the DLGTEMPLATE structure you pass in the lpTemplate parameter to any of these functions. You can also specify the DS_SETFOREGROUND or DS_CENTER style.

For a list of dialog box styles supported by Windows CE, see Window and Control Styles.