Use C + + to taste Vista Delicious: interface of the hair glass effect

Source: Internet
Author: User

Brief introduction

This article demonstrates how to use C + + to generate aero-glass effects in common Windows Vista windows-based applications and dialog boxes, using the Beta 2 version of Vista and the Windows SDK, perhaps in subsequent releases, Some APIs will change in detail. In addition, the article does not use MFC, all examples are generated with WTL 7.5, which can be downloaded in http://wtl.sourceforge.net/, although the use of Visual C + + 2003, but Visual C + + 2005 is similar.

Aero theme and the effect of glass, is with Vista "Desktop window Management (DWM)" and the new features, but also a focus of Microsoft marketing, integrated in the application of the glass effect, when the Aero theme open, the program will look very different--cool, right.

The effect of the hair glass in the Aero theme

When using Aero as the theme, Vista determines whether to turn on the glass effect based on the computer's graphics card, when the desktop is drawn by DWM, and DWM uses a composition process to render the desktop. It automatically uses the Aero theme element (somewhat like Windows XP) in the non-client area of the top-level window. And then again, it's not always going to add the effect of these hair glasses, if the computer is running in battery mode, or if the user decides to turn off the transparency effect, then the non-customer area will not have a glass effect, if the transparent glass effect is turned on in the visual effect of the Control Panel, the non client area looks like the following image:

Note that Notepad has a green border, which is the color of the wallpaper, and you can also see some icons on the desktop through the title bar.

When we write code, the key is to pay attention to whether the composition is open, rather than what the hair glass effect is, because the DWM will handle the part of the painted glass effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.