Page 157 - DCAP408_WEB_PROGRAMMING
P. 157

Unit 9: Child and Pop Up Windows




                                if(  LOBYTE(ToolboxMenuState)  &  MF_CHECKED  )                 Notes
                                {
                                       CheckMenuItem(hMenu,  IDM_VIEW_TOOLBOX,
                                       MF_BYCOMMAND  |  MF_UNCHECKED);
                                       ShowWindow(hWndToolbox,  SW_HIDE);
                                }
                                else
                                {
                                       CheckMenuItem(hMenu,  IDM_VIEW_TOOLBOX,
                                       MF_BYCOMMAND  |  MF_CHECKED);
                                       ShowWindow(hWndToolbox,  SW_SHOW);
                                }
                                break;

                         case  IDM_FILE_EXIT:
                                PostQuitMessage(WM_QUIT);
                                return  0;
                         };
                         break;


                 case  WM_SIZE:
                         GetClientRect(hWndMainFrame,  &rctMainWnd);
                         GetWindowRect(hWndToolbox,  &rctToolbox);


                         SetWindowPos(hWndToolbox,
                                         HWND_TOP,
                                             rctMainWnd.left,
                                         rctMainWnd.top,
                                                  rctToolbox.right  -  rctToolbox.left,
                                                  rctMainWnd.bottom,
                                                  SWP_NOACTIVATE  |  SWP_NOOWNERZORDER);

                         break;


                 case  WM_DESTROY:
                         PostQuitMessage(WM_QUIT);
                         break;


                 default:
                         return  DefWindowProc(hWnd,  Msg,  wParam,  lParam);
                 }




                                           LOVELY PROFESSIONAL UNIVERSITY                                   151
   152   153   154   155   156   157   158   159   160   161   162