1 / 14

Dialogs

Dialogs. Types:. Modal System modal Non modal (modeless). MessageBox. Four parameters: Parent window handle Message to show Title Flags. Modality. MB_APPLMODAL (default) MB_SYSTEMMODAL MB_TASKMODAL. Buttons. MB_ABORTRETRYIGNORE MB_CANCELTRYCONTINUE MB_OK MB_OKCANCEL

lhull
Download Presentation

Dialogs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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:

  8. 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.

  9. 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

  10. DLGTEMPLATE

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

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

More Related