Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dialogs.

Similar presentations


Presentation on theme: "Dialogs."— Presentation transcript:

1 Dialogs

2 Types: Modal System modal Non modal (modeless)

3 MessageBox Four parameters: Parent window handle Message to show Title
Flags

4 Modality MB_APPLMODAL (default) MB_SYSTEMMODAL MB_TASKMODAL

5 Buttons MB_ABORTRETRYIGNORE MB_CANCELTRYCONTINUE MB_OK MB_OKCANCEL
MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL MB_HELP

6 Icons MB_ICONEXCLAMATION MB_ICONWARNING MB_ICONINFORMATION
MB_ICONASTERISK MB_ICONQUESTION (not recommended) MB_ICONSTOP MB_ICONERROR MB_ICONHAND

7 Dialog window procedure
Differences with window: BOOL instead LRESULT WM_INITDIALOG EndDialog

8

9 Modal dialog window After dialog window procedure is defined, dialog window can be created with functions DialogBox or DialogBoxParam. Dialog window has two handles: dialog window itself and parent window’s. DialogBoxParam creates a modal dialog box from a dialog box template resource. It has 5th argument, which is sent to dialog procedure as LPARAM parameter of the WM_INITDIALOG MESSAGE.

10

11 Indirect dialog window
Functions DialogBoxIndirect or DialogBoxIndirectParam creates a modal box from a dialog box template DLGTEMPLATE(EX) structure DLGITEMTEMPLATE(EX) structure let define individual dialog window

12 DLGTEMPLATE

13 With class WNDCLASS structure can be used to define dialog:
wnd.cbWndWxtra = DLGWINDOWEXTRA; Register as simple window

14 Message loop IsDialogMessage is function used to modify message loop for modeless (not necessarily) dialog boxes


Download ppt "Dialogs."

Similar presentations


Ads by Google