Page 155 - DCAP408_WEB_PROGRAMMING
P. 155

Unit 9: Child and Pop Up Windows




                 WndClsEx.cbSize                =  sizeof(WNDCLASSEX);                          Notes
                 WndClsEx.style                  =  CS_HREDRAW  |  CS_VREDRAW;
                 WndClsEx.lpfnWndProc      =  MainWndProc;
                 WndClsEx.cbClsExtra        =  0;
                 WndClsEx.cbWndExtra        =  0;
                 WndClsEx.hIcon                  =  LoadIcon(NULL,  IDI_APPLICATION);
                 WndClsEx.hCursor              =  LoadCursor(NULL,  IDC_ARROW);
                 WndClsEx.hbrBackground                                              =
          static_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
                 WndClsEx.lpszMenuName    =    MAKEINTRESOURCE(IDR_MAIN_MENU);
                 WndClsEx.lpszClassName  =  strAppName;
                 WndClsEx.hInstance          =  hInstance;
                 WndClsEx.hIconSm              =  LoadIcon(NULL,  IDI_APPLICATION);


                 if  (!RegisterClassEx(&WndClsEx))
                         return  (FALSE);


                  hInst  =  hInstance;


                  hWndMainFrame  =  CreateWindow(strAppName,
                                           WndName,
                                             WS_OVERLAPPEDWINDOW,
                                         CW_USEDEFAULT,
                                           CW_USEDEFAULT,
                                           CW_USEDEFAULT,
                                           CW_USEDEFAULT,
                                           NULL,
                                           NULL,
                                           hInstance,
                                           NULL);


                  if(  !hWndMainFrame  )
                 return  (FALSE);




                  //  Create  a  child  window  based  on  the  available  dialog  box
                  hWndToolbox  =  CreateDialog(hInst,
                                                 MAKEINTRESOURCE(IDD_TOOLBOX_DLG),
                                      hWndMainFrame,
                                      (DLGPROC)ToolboxProc);





                                           LOVELY PROFESSIONAL UNIVERSITY                                   149
   150   151   152   153   154   155   156   157   158   159   160