DialogBoxIndirect

  int DialogBoxIndirect(hinst, hDialogTemplate, hwndOwner, dlgprc)    
  HANDLE hinst; /* handle of application instance */
  LPDLGTEMPLATE hDialogTemplate; /* handle of dialog template */
  HWND hwndOwner; /* handle of owner window */
  DLGPROC dlgprc; /* instance address of dialog proc */

This function creates an application's modal dialog box that has the size, style, and controls specified by the dialog-box template associated with the hDialogTemplate parameter. The hwndOwner parameter identifies the application window that owns the dialog box. The callback function pointed to by dlgprc processes any messages received by the dialog box.

The DialogBoxIndirect function does not return control until the callback function terminates the modal dialog box by calling the EndDialog function.

Parameters

hinst

Identifies the module that contains the dialog template resource.

hDialogTemplate

Identifies a block of global memory that contains a DLGTEMPLATE structure.

hwndOwner

Identifies the window that owns the dialog box.

dlgprc

Specifies the procedure-instance address of the dialog function. For more information about the dialog box procedure, see the description of the DialogProc callback function.

Return Value

The return value specifies the value of the wResult parameter specified in the EndDialog function that is used to terminate the dialog box. Values returned by the application's dialog box are processed by Windows and are not returned to the application. The return value is -1 if the function could not create the dialog box.

See Also

CreateDialog, CreateDialogIndirect, CreateDialogParam, CreateDialogIndirectParam, DialogBoxParam, DialogBoxIndirectParam DialogProc, EndDialog,