Welcome to shell: revealed Sign in | Join | Help
in Search

Shell Blog

Frequently asked questions about the Aero Basic window frame

Several people here and elsewhere have been asking why the Aero Basic window frame looks like it does, and why it is different from the Aero frame (especially the caption buttons).

Aero frame   Aero Basic frame

I won't give the technical explanation for every single detail here (that would be extremely boring), but I'll try to give you some answers. Here are some gory details nonetheless:

Anatomy of a caption
Anatomy of a caption bar

Why isn't the Close button oversized compared to the Minimize and Maximize buttons, like in Aero?
In pre-DWM Windows, all buttons must have the same size, because there's only one set of metrics to query the size of a button (SM_CXSIZE and SM_CYSIZE, see GetSystemMetrics()). If you look at the TITLEBARINFO structure returned by GetTitleBarInfo(), it says nothing about the size of the individual buttons.
A lot of applications draw their own buttons or even their own captions. Lots of accessibility tools report the position of the caption buttons. Some applications trigger actions by simulating a mouse click to a precise position. All those applications compute the position of buttons based on a multiple of SM_CXSIZE (plus delta), so if the Close button was bigger than SM_CXSIZE, those applications would get all their button positions wrong, so they could draw a new button right in the middle of existing buttons, or click on the Close button when thinking clicking on the Maximize button.
For Windows Vista we fixed this by exposing a new API, WM_GETTITLEBARINFOEX, but of course no application outside of Windows is using it yet. The Accessibility framework has been updated to use it.

Then how is the DWM getting away with it?
The DWM doesn't have any legacy worries because applications cannot draw inside the glass frame, since it's rendered and managed by a totally different process. If an application tries to do it, Windows will detect it and remove the glass frame entirely (and therefore revert to the Basic frame), so that the application can draw what it wants to draw.

Why didn't you change the legacy window manager then?
For application compatibility, of course. We have a brand new Window Manager (the DWM) where we focused the innovation, while trying not to touch the legacy window manager unless absolutely necessary, so that we can have *both* compatibility and innovation - best of both worlds.

Why aren't the caption buttons bigger in Aero Basic?
Like the anatomy picture above shows, the height of the buttons (SM_CYSIZE) determines the total height of the caption, so raising it would have made the caption even taller, and because of all the padding, the designers felt that the caption was already tall enough. So we made the buttons wider instead.
In the end, those buttons have a surface of 420 pixels where XP had 441 pixels so they're just 4.75% smaller than XP, which seemed good enough (XP had rather good sized captions). The Aero buttons are slightly taller and are 6% larger than XP, with the Close button being larger still, but in the end the difference isn't that big.

What if I don't like them this small?
We decided not to raise SM_CYSIZE by default, but that doesn't mean you can't do it yourself. Just go to Control Panel > Personalization > Window Color and Appearance (if you're running Aero there's an extra page with a Open Classic Appearance Properties for More Color Options link, see Vinny's post), click Advanced and change the Active Title Bar size. XP had 25.

What's with the extra border?
You will notice in the anatomy picture above an extra iPaddedBorderWidth padding, that wasn't there in XP. That's the glass border (4 pixels by default), upon which the Aero look is based.
This metric is new and different from the pre-existing border metric (iBorderWidth, 1 pixel by default):

  • iBorderWidth is used in a lot of places other than the window frame, like splitter windows and many surprising places. So if we increased it, you would have seen extra fat splitters, and other undesirable effects.
  • Contrary to iBorderWidth, iPaddedBorderWidth affects both resizable (thick) and non-resizable (thin) frames (so it makes thin frames not-so-thin anymore, which was desired for glass).

In a nutshell: 

thick frame padding = iBorderWidth + iPaddedBorderWidth
thin  frame padding =       1      +
iPaddedBorderWidth

So even in Aero, if you like thick borders but not for non-resizable windows, you can set the padded border to 0 and increase the "Active Window Border" instead; you'll get thick glass borders, but in less places (although you'll get the side effects of thick splitters, etc.).

But I'm running Aero Basic not Aero so I don't have glass, so why put a thick "glass" border there?
We deemed important to have only one set of system metrics for both Aero and Aero Basic. It has several advantages:

  • It ensures a consistent user experience between both modes, and therefore a consistent user experience across the breadth of Windows installations
  • It ensures consistency between top-level and MDI child frames, even with Aero
  • Applications only have to adapt once to one set of new metrics
  • It allows the DWM to turn itself on and off quickly based on transient conditions (for example if you launch a program that grabs exclusive graphic resources, or you run out of graphics or system memory, or you're connecting via Remote Desktop with glass disabled, etc.) without going through a lengthy system setting change broadcast, that would most likely hang your machine for 30 seconds while all applications re-layout and repaint (while sometimes *forgetting* to pump messages, hence the hang), or falling into a temporary hybrid mode that doesn't match any other normal configuration. 

What if I don't like it?
Like for the caption height, both values can be changed in the Personalization CPL.
To go back to the XP frame padding, just set the Border Padding to 0:

Aero Basic frame with Border Padding set to 0

To *really* go back to an XP-style frame, also set the Active Title Bar size to 25:

Aero Basic frame with Border Padding set to 0 and Active Border Size set to 25

So are those buttons big enough for you now? ;-)

Why does Aero have a solid 1-pixel black border inside the frame, and Aero Basic doesn't?
Because the DWM is rendering this black border, and the DWM is absent in Aero Basic. The glass starts in the non-client area and stops after the client glass margin, and there's intentionally no seam between the client and non-client glass areas.
This client/non-client blend illusion is kept in Aero Basic for windows without caption text, like Explorer and the Aero Wizards. So if we added a solid border to the Aero Basic frame, here's how it would look:

You can see how this solid border is a problem visually.
We couldn't just put a solid border on the left, bottom and right edges but end abruptly at the top, and we couldn't make the client area responsible for drawing this border - the whole point of skinning is to be able to vary the non-client area without affecting the client area, so the application should have no knowledge of this.
We tried several different approaches, like this one:

But none of them looked right.
We could have tried implementing several types of frames for different types of applications, but the engineering cost was high and there was a risk of regressions, so in the end we decided to keep things simple, and just removed the solid border from the Aero Basic frame.

So that's the story of it. In the end, different methods are used to draw Basic and Aero, each with different constraints. Basic was designed to complement Aero, but in working with greater constraints trade-offs were necessary.

Published Thursday, October 12, 2006 11:51 PM by lm [MSFT]

Comments

 

divil said:

So how does Office maintain glass while also drawing over the glass, e.g. titlebar text and the round Office button? And even arbitrary buttons in their quick access toolbar?

October 13, 2006 4:12 AM
 

lm [MSFT] said:

Office completely removes the non-client area, and renders everything in its client area, so it doesn't have a caption (except a fake one).

Notice how the glow and the text are different, it's because they're not rendered by the DWM.

October 13, 2006 4:28 AM
 

tino said:

Oh Jesus. What a bad design. Can't belief this! The caption buttons are only 4 to 6 % smaller than in XP? Yes mathematically. But not in reality. So you really think a button with an height of 1 pixel and a width of 441 pixels is as usable as the 441 pixel square in XP? What? Are you serious?

If you can't arrange the old school caption buttons to the top border, why not draw the AERO glass buttons at the same position? Now we got swimming caption buttons. (and i does not mention the classic theme!)

A design of 1000 excuses. IMO, AERO basic is inferior to Luna. It feels like your designers have Apple stocks ;-P

October 13, 2006 5:13 AM
 

Csybe said:

We will be glad if you write some lines about why aren't we allowed to change the color of the Basic theme...

October 13, 2006 6:01 AM
 

timmis said:

tino: Check out Fitt's Law,

http://blogs.msdn.com/jensenh/archive/2006/08/22/711808.aspx

Aquirement time varies with 2 times the area over the width (along the axis of motion) so the new style is actually not too bad when moving towards the button from any direction except directly underneath. :-)

October 13, 2006 8:26 AM
 

tino said:

@timmis: Fitt's law says: "W is the width of the target measured along the axis of motion". The axis of motion by hitting the caption buttons is almost always vertical so the new caption buttons are smaller says Fitt's law. Where did you found this about the target area?

But the point is: there is so much unused space! And don't forget there are now higher resolutions on displays as in 2001 when XP was released. I belief that 95 and XP where so succesfull because of the clean GUI. I don't see this for Vista

October 13, 2006 9:11 AM
 

Snprbob86 said:

The basic theme really is rather horrid. What's worse, is that I don't see any included way to opt for an XP or XP Media/Tablet theme.

October 13, 2006 10:52 AM
 

timmis said:

@tino: You're right, I misread that

October 13, 2006 11:45 AM
 

Andre Da Costa said:

Seriously though, its not a goodlooking theme, I wished you incorporated elements of Luna with improvements to the Shell itself.

October 13, 2006 12:41 PM
 

Csybe said:

Agreet, XP's Luna looks way better, and that's sad.

October 13, 2006 3:01 PM
 

wavey said:

I'm hoping that a reworking of the basic theme is one of the 'visual features' they have been holding back so that they can still surprise people at launch. Remember they did exactly that with XP, using the WaterColor theme until they shipped

October 13, 2006 4:34 PM
 

leduytien said:

Hi,

So you said "applications cannot draw inside the glass frame, since it's rendered and managed by a totally different process".

Does this mean that there is no way to have an application with the entire area as a glass panel?

For example, I want to create an application that have the background unified with the title bar as well as the border with the glassy effect (and without the 1-pixel black border separated the glassy border and the application's area)

October 14, 2006 4:29 AM
 

kiwiblue said:

@leduytien: you can use DwmExtendFrameIntoClientArea. For more info go to Greg Schechter's weblog (the article links to few other pages demonstrating how to extend glass into your client area):

http://blogs.msdn.com/greg_schechter/archive/2006/09/14/753605.aspx

October 14, 2006 6:59 AM
 

Jozsef said:

The salient feature of the Vista buttons to me is their position in Aero more than the relative sizes of the buttons. I would still like to know why they can't be right at the top edge of the caption bar in basic and also why a hobbyist could create a visual style for XP that seems to duplicate all the aspects of Aero under discussion. I'm not alleging a conspiracy, just confessing puzzlement.

October 15, 2006 3:13 AM
 

lm [MSFT] said:

CSybe, check out this thread about why the colors of the Aero Basic frame cannot be changed: http://shellrevealed.com/forums/thread/4556.aspx

October 15, 2006 5:54 PM
 

lm [MSFT] said:

Jozsef, the buttons cannot be right at the top edge because applications expect windows with WS_THICKFRAME to have an area of SM_CYFRAME around them that hit-tests like HTTOP above the buttons, followed by a SM_CYEDGE area that hit-tests like the button.

Anybody can write a global message hook DLL that will make the caption buttons have any shape or form, but that will break most applications that interact with the caption bar directly (including those applications that have a global message hook themselves).

October 15, 2006 6:00 PM
 

PatriotB said:

One unfortunate detail about the border width / padded border width changes is that some modal dialogs (e.g. without a sizing border) have padded borders while others don't.  It's a visually jarring experience.

For example, the vast majority of Vista's built-in dialogs have the padded border.  A notable exception is Internet Explorer dialogs.

Interestingly, it's not based upon what APIs you call: the same dialog box (or message box) from two different apps can have two different looks.

I did some investigating, and found that the factor that determines whether you get padding or not, is the subsystem version you specify in your EXE file.  If you specify version 6.0, you get the padding; anything lower and you don't.

I understand that you wanted to keep the old metrics in use by default for compatibility with apps that draw in the nonclient area.  But it's unfortunate that you based it on the subsystem version number.

As a developer I'd prefer to have one version of my EXEs that can run on both Vista and XP.  Which means I can't use the padding.  A manifest setting would have been preferable, that way I could say that my app is okay with padded borders, but the app would still run on prior versions of Windows.

October 16, 2006 3:38 AM
 

BERT_UK said:

> In pre-DWM Windows, all buttons must have the same size, because there's only one set of

>metrics to query the size of a button (SM_CXSIZE and SM_CYSIZE, see GetSystemMetrics()). If

> you look at the TITLEBARINFO structure returned by GetTitleBarInfo(), it says nothing about the > size of the individual buttons.

I don't understand then how WMP11 beta on XP has an oversized close caption button?  The caption buttons are also on the edge of the window's border.  What is going on here?

Please explain! :)

October 16, 2006 12:37 PM
 

kiwiblue said:

@BERT_UK: WMP11 doesn't have any nonclient area (unless you enable "classic menus") and paints entire window itself - including these buttons.

If you enable "classic menus", then window gets border and NC area buttons drawn by Windows. The main menu itself is implemented as a toolbar in a rebar, btw.

October 16, 2006 1:17 PM
 

lm [MSFT] said:

PatriotB: you are correct. IEXPLORE.EXE ships downlevel, so is marked as 5.02 (note that the Internet Options dialog is launched by IEUSER.EXE on Windows Vista, so is marked 6.0 and is not affected).

The extra border padding for dialogs was found to break too many applications, so is active only for new applications.

The plan of record was indeed to expose a way for applications marked as < 6.0 to opt in to the border padding via a manifest setting, but apparently this feature didn't make it. There is an app compat flag to switch to v5 behavior for v6 apps, but not the other way around. There is also a setting to turn off wide borders altogether for your application, even for resizable frames (some applications crash as soon as you change the border width, even on XP).

Note that this is only visible with Aero Basic, since with Aero, the DWM will overdraw the glass frame around the dialogs (without changing their size), so they are visually indistinguishable from other dialogs. (BTW when a dialog is overdrawn this way in Aero, you can query the extended frame bounds via the new DWMWA_EXTENDED_FRAME_BOUNDS value of the DWMWINDOWATTRIBUTE enum, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/dwmgetwindowattribute.asp. This will be fully documented in the final release of the Windows SDK).

Note that using the MajorSubsystemVersion is nothing new, we did it for Windows 95/NT 4.0 - the window manager behaves quite differently if you're not compiled as a 4.0+ application.

The difference between the subsystems is:

For < 6.0 apps (at 96dpi):

 iBorderWidth = 5

 iPaddedBorderWidth = SM_CXPADDEDBORDER = 0

 SM_CXFRAME = 8

For 6.0+ apps (at 96dpi):

 iBorderWidth = 1

 iPaddedBorderWidth = SM_CXPADDEDBORDER = 4

 SM_CXFRAME = 4

I told you I wasn't giving all the details in this post :-)

October 17, 2006 4:50 AM
 

lm [MSFT] said:

There's a chance that both issues (application manifest and IE dialogs) might get addressed for Windows Vista SP1 - no guarantees, though.

October 17, 2006 1:05 PM
 

Aaron's UI Design Blog said:

An article on shell revealed goes into a great deal of depth about why the Windows Vista Aero Basic theme looks the way it does. Why does Aero have a solid 1-pixel black border inside the frame, and Aero Basic...

October 20, 2006 10:02 AM
 

panjkov said:

Is there any way to run aero interface on pc with radeon 9250 card? i know that it is not dx9 card and i don't have pixel shader 2 but... i still hope that there is a way to do it

:-)

October 28, 2006 3:55 AM
 

heikosch said:

Im [MSFT] mentions "a setting to turn off wide borders altogether for your application".

I´d like to do it for some older Win32 apps with very narrow dialog layout that are clipped with wide borders.

What to do?

November 16, 2006 10:18 AM
 

lm [MSFT] said:

You can use the Microsoft Application Compatibility Toolkit (ACT) 5.0 (see URL) to apply the NoPaddedBorder shim to those applications.

November 16, 2006 5:39 PM
 

lm [MSFT] said:

November 16, 2006 5:40 PM
 

heikosch said:

@Im Thank you very much. It works with the appcompat fix! :-)

But as a developer and not an administrator I would prefer a programmatically solution.

Is it possible to set the border padding from code or at least to apply the appcompat fix in my application?

November 17, 2006 12:25 PM
 

lm [MSFT] said:

If you can recompile the application, then you can fix it to behave properly, which is to use the AdjustWindowRectEx() function to compute the client area size.

We found that applications broken by the large borders were already broken on XP when you set a larger border via the control panel.

Also, if you link your application with the /SUBSYSTEM:WINDOWS,6.0 linker setting, GetWindowRect() will always include the padded border for non-resizable windows.

November 17, 2006 3:41 PM
 

lm [MSFT] said:

Note also that the ACT produces a .SDB file that you can programmatically deploy with your application, for example by invoking SDBINST.EXE.

November 17, 2006 4:09 PM
 

hvassbotn said:

You said:

> applications cannot draw inside the glass frame, since it's rendered and managed by a totally

>different process. If an application tries to do it, Windows will detect it and remove the glass

>frame entirely (and therefore revert to the Basic frame), so that the application can draw what it

>wants to draw.

But this does not seem to work?!

This is a demo of custom caption buttons that work fine on XP:

http://www.appcontrols.com/tips/components/captionbutton.html

But on Vista it still runs with Glass frame and no visible custom caption buttons. What triggers the detaction? How can one create an app with custom caption buttons that work both on XP and Vista?

December 22, 2006 8:18 AM
 

lm [MSFT] said:

The system will detect that the app is painting its own non-client area when it doesn't pass WM_NCPAINT to DefWindowProc(), or passes it with a different WPARAM. Changing the WS_VISIBLE style of a top level window directly will also trigger it.

It seems that the demo app doesn't do any of this.

You can explicitely disable the glass frame for a given window with DwmSetWindowAttribute(DWMWA_NCRENDERING_POLICY) and DWMNCRP_DISABLED.

In future versions of Windows, the custom painting detection might be improved to handle more cases.

January 3, 2007 8:52 PM
 

Shubba said:

Why did this link disappear? I would like to know if there is a way to change the aero-basic.

http://shellrevealed.com/forums/thread/4556.aspx

March 19, 2007 7:47 PM
 

R->3rdProject(); said:

VistaのAero表示時のサイズ変更不可ダイアログのウィンドウをGetWind...

July 30, 2007 11:40 AM
 

t mobile samsung e315 said:

t mobile samsung e315

October 28, 2007 8:38 PM
Anonymous comments are disabled

About lm [MSFT]

I am a developer working on various aspects of the Windows UI Platform, including the visual styles. I've been on the Shell team for six years.
Powered by Community Server, by Telligent Systems © 2006 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement.