Page 61 - DCAP408_WEB_PROGRAMMING
P. 61

Unit 4: Windows Controls




          14.   In the Properties window, click ID and type IDC_CLOSE_BTN                       Notes
          15.  On the dialog box, right-click the button and click Add Variable...
          16.  In the Access combo box, select private
          17.  In the Variable Name, type m_BtnClose




































          18.  Click Finish

          19.  In  the  Class  View, enlarge  the  project.  In the  upper  part  of  the  Class  View,  click
               CAppLauncher1
          20.  In the lower part of the Class View, double-click OnInitDialog()

          21.  Set the caption of the button to “Close” as below:
          BOOL  CAppLauncher1Dlg::OnInitDialog()
          {
          CDialogEx::OnInitDialog();


                  //  Add  “About...”  menu  item  to  system  menu.


                  //  IDM_ABOUTBOX  must  be  in  the  system  command  range.
                  ASSERT((IDM_ABOUTBOX  &  0xFFF0)  ==  IDM_ABOUTBOX);
                  ASSERT(IDM_ABOUTBOX  <  0xF000);

                  CMenu*  pSysMenu  =  GetSystemMenu(FALSE);
                  if  (pSysMenu  !=  NULL)




                                           LOVELY PROFESSIONAL UNIVERSITY                                   55
   56   57   58   59   60   61   62   63   64   65   66