The information in this article applies to:
SUMMARYChildMnu.exe demonstrates one way to embed a pop-up window with menus in a child window to simulate a child window with menus.Child windows by design do not have menus; however, some applications may require such child windows. MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. Child windows were not designed to have menus but under certain circumstances an application may require a child window with menus. Below are the steps to simulate a child window with menus:
Other ConsiderationsMaximizing: When a child window is maximized, it uses the screen's maximum size. To have the child window act similar to an MDI child, two messages need to be processed; WM_SIZE in the main parent's window procedure and WM_GETMINMAXINFO in the child's window procedure.WM_SIZE of the child's parent window procedure checks for SIZE_MAXIMIZE and SIZE_RESTORE. Then, if the child window is maximized, call ShowWindow() with SW_MAXIMIZED. This method adjusts the child window's size to the new size of the parent's client area. On WM_GETMINMAXINFO of the child's window procedure, calculate the size of the parent's client area. Use the newly calculated size and set the ptMaxSize variable of the MINMAXINFO structure. This ensures that the child is always fully contained within its parent client area when maximized. Additional query words:
Keywords : kbfile kbsample kb16bitonly kbMenu kbGrpUser kbWinOS310 kbWndw kbWndwProp |
Last Reviewed: December 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |