• Home /Exam Details (QP Included)>Main Exam>Optional Subject-Medical Group>Computer Science / W.B.C.S. Examination Notes On – Dialog Box And Its Items – Computer Science Notes.
  • W.B.C.S. Examination Notes On – Dialog Box And Its Items – Computer Science Notes.

    Dialog boxes  are the grey windows that pop up on Windows systems to display messages, and allow the user to set parameters. There are 3 types of dialog boxes: modeless, modal, and system modal.Continue Reading W.B.C.S. Examination Notes On – Dialog Box And Its Items – Computer Science Notes.

    Modal
    Modal dialog boxes are generally used inside a program, to display messages, and to set program parameters. Modal dialog boxes come to the front of the screen, and you may not use the program while the modal dialog box is open. to continue using the program, the modal dialog box must be closed.
    System Modal
    System modal dialog boxes are like modal boxes, except that they supersede the entire desktop area. When a system modal dialog box is open, nothing else on the screen can be clicked or selected.
    Modeless
    Modeless dialog boxes are able to be deselected, and control can be taken away from a modeless dialog box and transferred to some other window. Modeless dialog boxes are frequently used as a fast and easy way to create a window, without having to register a window class. Modeless dialog boxes are common in the Windows control panel.

    The most simple type of dialog box is the MessageBox function. The MessageBox function takes 5 parameters: a handle to a parent, a message, a title, and an option. If the parent handle is NULL, the message box is modeless. If you provide a handle for a parent window, the MessageBox can become Modal to the parent window.

    MessageBox dialog boxes have a number of different options that can be specified: Button types, Icons, modality (modal/modeless), and text justification. These options are specified as bit flags, that can be used by bitwise ORing them together.

    Buttons

    Message boxes can have standard OK or Cancel buttons, or they can have a “Yes, No, Cancel” configuration, or a number of derivatives. Only one primary button scheme can be used per message box:

    • MB_ABORTRETRYIGNORE: The message box contains three push buttons: Abort, Retry, and Ignore.
    • MB_CANCELTRYCONTINUE: Same as MB_ABORTRETRYIGNORE, but preferred on Windows 2000/XP.
    • MB_OK: The message box contains an “OK” button. This is the default.
    • MB_OKCANCEL: The message box contains two push buttons: OK and Cancel.
    • MB_RETRYCANCEL: The message box contains two push buttons: Retry and Cancel.
    • MB_YESNO: The message box contains two push buttons: Yes and No.
    • MB_YESNOCANCEL: The message box contains three push buttons: Yes, No, and Cancel.

    To display an icon in the message box, specify one of the following values. In addition, a message box can add an additional “Help” button by specifying the “MB_HELP” flag. A “Default Button”, a concept that we will see frequently in this chapter, is the button that is automatically selected when a dialog box is opened. Windows provides the ability to set the default button to any of the buttons on a message box, by using the MB_DEFBUTTONx macro.

    Icons

    A message box may have no icons, or it may have one. You shouldn’t specify a message box to have multiple icons. The different icons, according to MSDN are:

    • MB_ICONEXCLAMATION: An exclamation point icon appears in the message box.
    • MB_ICONWARNING: An exclamation point icon appears in the message box.
    • MB_ICONINFORMATION: An icon consisting of a lowercase letter i in a circle appears in the message box.
    • MB_ICONASTERISK: An icon consisting of a lowercase letter i in a circle appears in the message box.
    • MB_ICONQUESTION: A question mark icon appears in the message box.
      The question mark message icon is no longer recommended because it does not clearly represent a specific type of message and because the phrasing of a message as a question could apply to any message type. In addition, users can confuse the message symbol question mark with Help information. Therefore, do not use this question mark message symbol in your message boxes. The system continues to support its inclusion only for backward compatibility.
    • MB_ICONSTOP: A stop sign icon appears in the message box.
    • MB_ICONERROR: A stop sign icon appears in the message box.
    • MB_ICONHAND: A stop sign icon appears in the message box.

    Dialog box procedures are slightly different from window procedures. Specifically, they return BOOL values, instead of LRESULT values. Also, dialog boxes do not have a default message processing function, because messages don’t always need to be handled. Specifically, Windows manages dialog boxes, and Windows will handle the unused messages. If a dialog box processes a certain message, it should return TRUE. If the message is not processed, the function should return FALSE. Also, Dialog boxes do not get a WM_CREATE message, but instead get a WM_INITDIALOG message. Furthermore, when a dialog box has finished its business, it should call the EndDialog function.

    Please subscribe here to get all future updates on this post/page/category/website

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

     WBCS Foundation Course Classroom Online 2024 2025 WBCS Preliminary Exam Mock Test WBCS Main Exam Mock Test WBCS Main Language Bengali English Nepali Hindi Descriptive Paper