EndDialog

2.x

  void EndDialog(hwndDlg, nResult)    
  HWND hwndDlg; /* handle of dialog box */
  int nResult; /* value to return, */  

The EndDialog function hides a modal dialog box and causes the DialogBox function to return.

Parameters

hwndDlg

Identifies the dialog box to be destroyed.

nResult

Specifies the value that is returned to the caller of DialogBox.

Return Value

This function does not return a value.

Comments

The EndDialog function is required to complete processing of a modal dialog box created by the DialogBox function. An application calls EndDialog from within the dialog box procedure.

A dialog box procedure can call EndDialog at any time, even during the processing of the WM_INITDIALOG message. If the function is called while WM_INITDIALOG is being processed, the dialog box is hidden before it is shown and before the input focus is set.EndDialog does not destroy the dialog box immediately. Instead, it sets a flag that directs Windows to destroy the dialog box when the DialogBox function returns.

See Also

DialogBox