What?s the difference between Modal and Modeless Dialog?

Answer Posted / mahesh vanama

You create a modal dialog box by using the DialogBox function. You must specify the identifier or name of a dialog box template resource and a pointer to the dialog box procedure. The DialogBox function loads the template, displays the dialog box, and processes all user input until the user closes the dialog box.
In the following example, the application displays a modal dialog box when the user clicks Delete Item from an application menu. The dialog box contains an edit control (in which the user enters the name of an item) and OK and Cancel buttons. The control identifiers for these controls are ID_ITEMNAME, IDOK, and IDCANCEL, respectively.
Creating a Modeless Dialog Box
You create a modeless dialog box by using the CreateDialog function, specifying the identifier or name of a dialog box template resource and a pointer to the dialog box procedure. CreateDialog loads the template, creates the dialog box, and optionally displays it. Your application is responsible for retrieving and dispatching user input messages to the dialog box procedure.

In the following example, the application displays a modeless dialog box — if it is not already displayed — when the user clicks Go To from an application menu. The dialog box contains an edit control, a check box, and OK and Cancel buttons. The dialog box template is a resource in the application's executable file and has the resource identifier DLG_GOTO. The user enters a line number in the edit control and checks the check box to specify that the line number is relative to the current line. The control identifiers are ID_LINE, ID_ABSREL, IDOK, and IDCANCEL

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers

1801


What is the difference between Struts and JSF? Pls list some most suitable differences.

2841


How do I create a dialog box in mfc?

605


List out the basic features of MFC.

13673


Do you have an idea about MFC?

902






what message is sent to an application when the user presses the primary button?

1380


what is the meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?

3322


how to repaint when working with horizontal scroll bar

1538


How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?

682


I want recent paper pattern for HP company?

1775


what is functioning of DIalodDataXchange ..?

1182


What does mfc stand for?

947


plzz tell me what we can do and dont in tally ERP & sap business one?

1869


What is mfc class hierarchy?

609