EndDialog
EndDialog is a Windows API function used to terminate a modal dialog box and return a result to the caller that created the dialog. It is part of the Win32 API and is typically declared as VOID EndDialog(HWND hDlg, INT_PTR nResult). The hDlg parameter identifies the dialog box to close, and nResult is the value that will be returned by the function that created the dialog (such as DialogBox or DialogBoxParam).
When EndDialog is called, the dialog’s message loop ends, the dialog window is destroyed, and execution returns
Usage generally occurs within a dialog procedure in response to user actions. Common practice is to call
EndDialog is intended for modal dialogs created with functions like DialogBox, DialogBoxParam, or DialogBoxIndirectParam. It is