Dialog Boxes

Overview of the Dialog Boxes technology.

To develop Dialog Boxes, you need these headers:

For programming guidance for this technology, see:

Functions

Title Description
CommDlgExtendedError Returns a common dialog box error code. This code indicates the most recent error to occur during the execution of one of the common dialog box functions.
CreateDialogA Creates a modeless dialog box from a dialog box template resource. The CreateDialog macro uses the CreateDialogParam function.
CreateDialogIndirectA Creates a modeless dialog box from a dialog box template in memory. The CreateDialogIndirect macro uses the CreateDialogIndirectParam function.
CreateDialogIndirectParamA Creates a modeless dialog box from a dialog box template in memory.
CreateDialogIndirectParamW Creates a modeless dialog box from a dialog box template in memory.
CreateDialogIndirectW Creates a modeless dialog box from a dialog box template in memory. The CreateDialogIndirect macro uses the CreateDialogIndirectParam function.
CreateDialogParamA Creates a modeless dialog box from a dialog box template resource.
CreateDialogParamW Creates a modeless dialog box from a dialog box template resource.
CreateDialogW Creates a modeless dialog box from a dialog box template resource. The CreateDialog macro uses the CreateDialogParam function.
DefDlgProcW Calls the default dialog box window procedure to provide default processing for any window messages that a dialog box with a private window class does not process.
DialogBoxA Creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
DialogBoxIndirectA Creates a modal dialog box from a dialog box template in memory. DialogBoxIndirect does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
DialogBoxIndirectParamA Creates a modal dialog box from a dialog box template in memory.
DialogBoxIndirectParamW Creates a modal dialog box from a dialog box template in memory.
DialogBoxIndirectW Creates a modal dialog box from a dialog box template in memory. DialogBoxIndirect does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
DialogBoxParamA Creates a modal dialog box from a dialog box template resource.
DialogBoxParamW Creates a modal dialog box from a dialog box template resource.
DialogBoxW Creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
DLGPROC Application-defined callback function used with the CreateDialog and DialogBox families of functions.
EndDialog Destroys a modal dialog box, causing the system to end any processing for the dialog box.
FindTextA Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document.
FindTextW Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document.
GetCurrentDevMode Fills a DEVMODE structure with information about the currently selected printer for use with PrintDlgEx.
GetCurrentPortName Retrieves the name of the current port for use with PrintDlgEx.
GetCurrentPrinterName Retrieves the name of the currently selected printer, for use with PrintDlgEx.
GetDialogBaseUnits Retrieves the system's dialog base units, which are the average width and height of characters in the system font.
GetDlgCtrlID Retrieves the identifier of the specified control.
GetDlgItem Retrieves a handle to a control in the specified dialog box.
GetDlgItemInt Translates the text of a specified control in a dialog box into an integer value.
GetDlgItemTextA Retrieves the title or text associated with a control in a dialog box.
GetDlgItemTextW Retrieves the title or text associated with a control in a dialog box.
GetFileTitleA Retrieves the name of the specified file.
GetFileTitleW Retrieves the name of the specified file.
GetNextDlgGroupItem Retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control in a dialog box.
GetNextDlgTabItem Retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control.
GetOpenFileNameA Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to be opened.
GetOpenFileNameW Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to be opened.
GetSaveFileNameA Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save.
GetSaveFileNameW Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save.
HandleMessage Called by PrintDlgEx to give your application an opportunity to handle messages sent to the child dialog box in the lower portion of the General page of the Print Property Sheet.
InitDone Called by PrintDlgEx when the system has finished initializing the General page of the Print Property Sheet.
IsDialogMessageA Determines whether a message is intended for the specified dialog box and, if it is, processes the message.
IsDialogMessageW Determines whether a message is intended for the specified dialog box and, if it is, processes the message.
LPCCHOOKPROC Receives messages or notifications intended for the default dialog box procedure of the Color dialog box. This is an application-defined or library-defined callback function that is used with the ChooseColor function.
LPCFHOOKPROC Receives messages or notifications intended for the default dialog box procedure of the Font dialog box. This is an application-defined or library-defined callback procedure that is used with the ChooseFont function.
LPFRHOOKPROC Receives messages or notifications intended for the default dialog box procedure of the Find or Replace dialog box.
LPOFNHOOKPROC Receives notification messages sent from the dialog box.
LPPAGEPAINTHOOK Receives messages that allow you to customize drawing of the sample page in the Page Setup dialog box. The PagePaintHook hook procedure is an application-defined or library-defined callback function used with the PageSetupDlg function.
LPPAGESETUPHOOK Receives messages or notifications intended for the default dialog box procedure of the Page Setup dialog box. The PageSetupHook hook procedure is an application-defined or library-defined callback function used with the PageSetupDlg function.
LPPRINTHOOKPROC Receives messages or notifications intended for the default dialog box procedure of the Print dialog box. This is an application-defined or library-defined callback function that is used with the PrintDlg function.
LPSETUPHOOKPROC An application-defined or library-defined callback function used with the PrintDlg function. The hook procedure receives messages or notifications intended for the default dialog box procedure of the Print Setup dialog box.
MapDialogRect Converts the specified dialog box units to screen units (pixels).
MessageBox Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
MessageBoxA Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
MessageBoxExA Creates, displays, and operates a message box.
MessageBoxExW Creates, displays, and operates a message box.
MessageBoxIndirectA Creates, displays, and operates a message box. The message box contains application-defined message text and title, any icon, and any combination of predefined push buttons.
MessageBoxIndirectW Creates, displays, and operates a message box. The message box contains application-defined message text and title, any icon, and any combination of predefined push buttons.
MessageBoxW Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
ReplaceTextA Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations.
ReplaceTextW Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations.
SelectionChange Called by PrintDlgEx when the user selects a different printer from the list of installed printers on the General page of the Print Property Sheet.
SendDlgItemMessageA Sends a message to the specified control in a dialog box.
SendDlgItemMessageW Sends a message to the specified control in a dialog box.
SetDlgItemInt Sets the text of a control in a dialog box to the string representation of a specified integer value.
SetDlgItemTextA Sets the title or text of a control in a dialog box.
SetDlgItemTextW Sets the title or text of a control in a dialog box.

Interfaces

Title Description
IPrintDialogCallback Provides methods that enable an application to receive notifications and messages from the PrintDlgEx function while the Print Property Sheet is displayed.
IPrintDialogServices Provides methods that enable an application using the PrintDlgEx function to retrieve information about the currently selected printer.

Structures

Title Description
CHOOSEFONTA Contains information that the ChooseFont function uses to initialize the Font dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure.
CHOOSEFONTW Contains information that the ChooseFont function uses to initialize the Font dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure.
DEVNAMES Contains strings that identify the driver, device, and output port names for a printer.
DLGITEMTEMPLATE Defines the dimensions and style of a control in a dialog box. One or more of these structures are combined with a DLGTEMPLATE structure to form a standard template for a dialog box.
DLGTEMPLATE Defines the dimensions and style of a dialog box.
FINDREPLACEA Contains information that the FindText and ReplaceText functions use to initialize the Find and Replace dialog boxes.
FINDREPLACEW Contains information that the FindText and ReplaceText functions use to initialize the Find and Replace dialog boxes.
MSGBOXPARAMSA Contains information used to display a message box. The MessageBoxIndirect function uses this structure.
MSGBOXPARAMSW Contains information used to display a message box. The MessageBoxIndirect function uses this structure.
OFNOTIFYA Contains information about a WM_NOTIFY message sent to an OFNHookProc hook procedure for an Open or Save As dialog box. The lParam parameter of the WM_NOTIFY message is a pointer to an OFNOTIFY structure.
OFNOTIFYEXA Contains information about a CDN_INCLUDEITEM notification message.
OFNOTIFYEXW Contains information about a CDN_INCLUDEITEM notification message.
OFNOTIFYW Contains information about a WM_NOTIFY message sent to an OFNHookProc hook procedure for an Open or Save As dialog box. The lParam parameter of the WM_NOTIFY message is a pointer to an OFNOTIFY structure.
OPENFILENAME_NT4A The OPENFILENAME_NT4 structure is identical to OPENFILENAME with _WIN32_WINNT set to 0x0400.
OPENFILENAME_NT4W The OPENFILENAME_NT4 structure is identical to OPENFILENAME with _WIN32_WINNT set to 0x0400.
OPENFILENAMEA Contains information that the GetOpenFileName and GetSaveFileName functions use to initialize an Open or Save As dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure.
OPENFILENAMEW Contains information that the GetOpenFileName and GetSaveFileName functions use to initialize an Open or Save As dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure.
PAGESETUPDLGA Contains information the PageSetupDlg function uses to initialize the Page Setup dialog box. After the user closes the dialog box, the system returns information about the user-defined page parameters in this structure.
PAGESETUPDLGW Contains information the PageSetupDlg function uses to initialize the Page Setup dialog box. After the user closes the dialog box, the system returns information about the user-defined page parameters in this structure.
PRINTDLGA Contains information that the PrintDlg function uses to initialize the Print Dialog Box. After the user closes the dialog box, the system uses this structure to return information about the user's selections.
PRINTDLGEXA Contains information that the PrintDlgEx function uses to initialize the Print property sheet. After the user closes the property sheet, the system uses this structure to return information about the user's selections.
PRINTDLGEXW Contains information that the PrintDlgEx function uses to initialize the Print property sheet. After the user closes the property sheet, the system uses this structure to return information about the user's selections.
PRINTDLGW Contains information that the PrintDlg function uses to initialize the Print Dialog Box. After the user closes the dialog box, the system uses this structure to return information about the user's selections.
PRINTPAGERANGE Represents a range of pages in a print job. A print job can have more than one page range. This information is supplied in the PRINTDLGEX structure when calling the PrintDlgEx function.