Microsoft KB Archive/72136

{|
 * width="100%"|

HOWTO: Use a Modeless Dialog Box with No Dialog Function

 * }

Q72136

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1

-

SUMMARY
When creating a modeless dialog box with the default dialog class, an application normally passes a procedure-instance address of the dialog function to the CreateDialog function. This dialog function processes messages such as WM_INITDIALOG and WM_COMMAND, returning TRUE or FALSE.

It is acceptable to create a modeless dialog box that uses NULL for the lpDialogFunc parameter of CreateDialog. This type of dialog box is useful when the no controls or other input facilities are required. In this case, using NULL simplifies the programming.

However, the dialog box must be closed through some means other than a push button (for example, via a timer event).

NOTE: A modal dialog box that does not provide a means of closing itself will hang its parent application because control will never return from the DialogBox function call.

If lpDialogFunc is NULL, no WM_INITDIALOG message will be sent, and DefDlgProc does not attempt to call a dialog function. Instead, DefDlgProc handles all messages for the dialog. The application that created the modeless dialog must explicitly call DestroyWindow to free its system resources.

Additional query words:

Keywords : kbDlg kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK300 kbWinSDK310