The following image shows a standard window frame (on the left) and the same window frame extended (on the right). This ensures that frame extension is handled properly when the window is at its default size and when it is maximized. Note that the frame extension is done within the WM_ACTIVATE message rather than the WM_CREATE message. Hr = DwmExtendFrameIntoClientArea(hWnd, &margins) Margins.cyTopHeight = TOPEXTENDWIDTH // 27 Margins.cyBottomHeight = BOTTOMEXTENDWIDTH // 20 Margins.cxRightWidth = RIGHTEXTENDWIDTH // 8 Margins.cxLeftWidth = LEFTEXTENDWIDTH // 8 Extend the frame into the client area. The following code demonstrates the use of DwmExtendFrameIntoClientArea to extend the frame. The margin inset values determine how far to extend the frame on the four sides of the window. To extend the frame, pass the handle of the target window together with the margin inset values to DwmExtendFrameIntoClientArea. The functionality to extend the frame into the client area is exposed by the DwmExtendFrameIntoClientArea function. For example, Microsoft Office Word 2007 draws the Office button and the Quick Access toolbar inside the custom frame while providing the standard Minimize, Maximize, and Close caption buttons, as shown in the following screen shot. The ability to extend the window frame also enables you to create custom frames while maintaining the window's look and feel. For example, Windows Internet Explorer 7 on Windows Vista integrates the navigation bar into the window frame by extending the top of the frame as shown in the following screen shot. This enables you to integrate a client UI element-such as a toolbar-into the frame, giving the UI controls a more prominent place in the application UI. One feature of the DWM APIs is the ability to extend the application frame into the client area. Using the DWM APIs, you can change the way the DWM renders a window's frame. In Windows Vista and later, the appearance of the non-client areas of application windows (the title bar, icon, window border, and caption buttons) is controlled by the DWM.
0 Comments
Leave a Reply. |