Search Wiki:
This is a project to accompany the WPF SDK blog article about how to customize the window chrome in WPF apps.

It has a sample project with source that implements the techniques described in the article, as well as a sample application (an address book using Vista's Windows Contacts) that uses the Chrome project to create a UI similar to what Office 2007 does with its caption area.

The AddressBook.xaml file in the sample project demonstrates how to use the ChromeHelper object. Applications written using the ChromeHelper should work on Vista and XP, though the Glass options will not have any effect on systems without DWM composition enabled.

Feedback is appreciated. Any questions about, or issues with, the design or implementation can be posted to the Discussions tab.

Update 2008 Sept 9:
Updated the src files because there was an issue loading in Blend. No functional changes to anything, just hand tweaked the csproj and sln files a bit.
Last edited Sep 9 2008 at 8:49 PM  by JoeCastro, version 6
xeonix wrote  Nov 6 2008 at 7:08 PM  
Chrome is cool! With it i can add a Button, so one of it's part is in Window's caption and the other part - in client area.
but, there is one problem:
i'm adding a Button like in Office 2007 to the left upper corner of Window, so part of Button is on Window's caption and the other part - on client area. if mouse pointer on the Button's part which is in client area - everythings woks fine, but when i point
Button's part which is in Window's Caption area, unlike Office 2007, HitTest, Click and all other events doesn't wok!
if you fix it, let me know:

JoeCastro wrote  Nov 20 2008 at 2:48 AM  
This should work, though you have to opt-in. It's supported by adding the attached property ext:WindowChrome.HitTestable="True" to the Button you want to put in the caption area. There's an example in the address book app.

KevinXi wrote  Apr 13 2009 at 5:37 AM  
I am developing WPF applications on Windows XP sp3, and I want to custom the non-client area and remove the white border.
Considering performance issues, I decide to avoid using layered mode in my window, so I tried Chrome library, it helps me to remove the unwanted border.

Recently, when I switch the window between full screen and normal state, I found a bug existed in Chrome:
when I set the window style to None, and set the state to maximized, the window will be displayed in full screen mode, but when I use Chrome and enter the full screen again, the window's bottom part will be covered by the system taskbar. Any ideas for this issue, contact me, thanks.

brianbruff wrote  Sep 22 2009 at 9:45 PM  
Nice sample.
Noticed a recursion bug in public static void ThrowLastError(), keeps calling itself.. but nice error handling all the same

JoeCastro wrote  Sep 29 2009 at 2:48 PM  
thanks. Global search and replace typo that I didn't catch in this snapshot. Should be ((HRESULT)Win32Error.GetLastError()).ThrowIfFailed();

Page view tracker