Retrieving Windows 8 Theme Colours

See also: Windows 8 Theme Colours Reference.

Windows 8 doesn’t offer developers access to system theme colours, unlike its cousin, Windows Phone. Even for a version 1 product, this seems like a strange omission. Then again, we still don’t have a working public API for retrieving the Aero glass colour (or whatever we call it now that Aero’s gone) 6 years after the release of Windows Vista.

The functions that the system uses to retrieve colours are defined in UxTheme.dll. In particular, we’re interested in GetImmersiveColorSetCount (export #94), GetImmersiveColorFromColorSetEx (export #95), GetImmersiveColorTypeFromName (export #96), GetImmersiveUserColorSetPreference (export #98) and GetImmersiveColorNamedTypeByIndex (export #100). Relying on undocumented functions is a bad idea, and will cause your program to fail certification, so you won’t be able to use them in apps distributed through the Windows Store anyway.

For desktop developers who still want to use these functions, read on. Just assume that they’ll break in future versions of Windows (or even with patches to Windows 8).

Screenshot of Windows 8 Colours

Continue reading “Retrieving Windows 8 Theme Colours”

FastPictureViewer Codec Pack, Windows 8 and WPF don’t play nicely together

Update (2012-09-06): After some trial and error, it seems the Canon Hack Development Kit (CHDK) component is causing the issue. If you’re experiencing the same problem, try removing this component.

Update (2012-09-05): The FastPictureViewer support team was unable to reproduce the issue, but suggested it might have something to do with the JPEG Auto-Rotate feature. I was able to resolve the issue by installing only the following components of the codec pack: Photoshop PSD, Lightroom Previews, Adobe DNG, Canon CR2, CRW, PDF Thumbnails and Control Panel. This suggests one of the other components was causing the conflict on my machines.

I use the FastPictureViewer Codec Pack for viewing DNG images in Windows Explorer, amongst other things. Unfortunately, however, installing version 3.3.0.69 of the codec pack in Windows 8 (64-bit) caused my installations of Visual Studio 2010, Visual Studio 2012, Blend 4 and Blend for Visual Studio 2012 to stop working to various extents. Both versions of Blend crash silently. The start pages in both versions of Visual Studio fail to load, with VS2010 displaying a ‘Content Load Error’ relating to ‘System.Windows.Baml2006.TypeConverterMarkupExtension’ throwing an exception. The error message displayed where the Visual Studio 2012 Solution Explorer belongs was more useful: ‘System.Runtime.InteropServices.COMException: The codec is in the wrong state. (Exception from HRESULT: 0x88982F04)’.

Uninstalling the codec pack caused everything to start working again. I’ll update this post if/when a future release resolves the incompatibility.

Screenshot of Visual Studio 2010 Error

Screenshot of Visual Studio 2012 Error 

More on Segoe UI in Windows 8

Note: the following is based on the Windows 8 Release Preview (build 8400) and may not accurately reflect the final version of Windows 8. I’ll update this post if there are changes in future builds.

Updated: The fonts have been updated in the public beta (Windows Consumer Preview) and release candidate (Windows Release Preview) and I’ve changed the tables below to reflect this. I was also made aware of some additional information about changes to Segoe UI, including new stylistic sets and support for ligatures: you can read more at Subacme.

Further to my earlier post about Segoe UI Light in Windows 8, I’ve done some more research into the changes to the Segoe family of fonts. The Fonts class in the .NET Framework was helpful for retrieving information about the fonts.

First off, Segoe Print and Segoe Script and their bold variants have not been modified and are still labelled version 5.02 and 5.00, respectively. All existing variants of Segoe UI have been updated, and there is one new variant: Segoe UI Semilight. The latter is in fact used as the caption and small caption font in Windows 8 – Windows Vista and Windows 7 used Segoe UI (Regular). The Windows Phone 7 platform includes Segoe WP Semilight, and Segoe UI Semilight seems to be a superset of that font.

Apparently new in the Windows 8 Release Preview are three italic variants: Segoe UI Light Italic, Segoe UI Semibold Italic and Segoe UI Semilight Italic.

The following tables summarise the differences in glyph and character counts between the Windows 7 and Windows 8 versions of the Segoe UI font family:

Segoe UI Regular

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.01 5.12 5.16 5.24
Glyphs 2899 4281 4490 4516
Characters 2658 3283 3423 3404

Segoe UI Bold

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.01 5.12 5.15 5.24
Glyphs 2899 4290 4428 4442
Characters 2658 3283 3421 3401

Segoe UI Italic

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.01 5.10 5.15 5.22
Glyphs 2381 2478 2597 3077
Characters 2130 2180 2299 2525

Segoe UI Bold Italic

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.01 5.10 5.15 5.22
Glyphs 2381 2478 2597 3077
Characters 2130 2180 2299 2525

Segoe UI Light

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.00 5.12 5.15 5.25
Glyphs 2380 4036 4178 4236
Characters 2131 3090 3230 3211

Segoe UI Light Italic

  Windows 8 Release Preview
Version 5.22
Glyphs 3089
Characters 2525

Segoe UI Semibold

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.00 5.12 5.16 5.24
Glyphs 2380 4089 4228 4242
Characters 2131 3144 3231 3211

Segoe UI Semibold Italic

  Windows 8 Release Preview
Version 5.22
Glyphs 3089
Characters 2525

Segoe UI Semilight

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version N/A 5.12 5.15 5.24
Glyphs N/A 4034 4175 4189
Characters N/A 3090 3230 3210

Segoe UI Semilight Italic

  Windows 8 Release Preview
Version 5.23
Glyphs 3089
Characters 2525

Segoe UI Symbol

  Windows 7 Windows 8 Developer Preview Windows 8 Consumer Preview Windows 8 Release Preview
Version 5.00 5.33 5.46 5.55
Glyphs 3090 5122 6785 6846
Characters 2864 4547 5092 5217

Supported Unicode Blocks

For further information about which Unicode blocks are supported by the Segoe family of fonts, you can download my extended analysis here:

segoe-analysis.7z
2,825 bytes; SHA-1: DFFA40934DB3305054C40AF3FD6E7224F5CF1EFB

Segoe UI Light Improvements in Windows 8

Windows 7 comes with Segoe UI Light version 5.00/0.90. Windows 8 (as of the Windows Consumer Preview) comes with version 5.15, which has been hinted at various sizes. This comes as a very welcome change, especially with Microsoft using Segoe UI Light all over the place in its latest webpage designs. I recommend grabbing the updated versions of Segoe UI from Windows 8 for your Windows 7 or Windows Vista machines.

As others have complained, the lack of hinting in version 5.00 is particularly noticeable with lowercase bs, ds, ps and qs, the ‘round parts’ of which don’t line up well with other characters. The heights of numerals are also variable at some sizes.

Have a look at the following screenshots for a better idea of the differences (click the images to see the full sizes).

Version 5.00

Screenshot of Segoe UI Light 5.00

Version 5.15

Screenshot of Segoe UI Light 5.15

Difference

Screenshot of the difference between Segoe UI Light 5.15 and Segoe UI Light 5.00

Facebook Messenger for Windows is not just for Windows 7

Facebook recently launched ‘Messenger for Windows’, a desktop client for Facebook chat.

The Messenger for Windows help page suggests that the program requires Windows 7:

What kind of computer operating system do I need in order to use Messenger for Windows?
You can set up the app if you use Windows 7 on your computer.

In fact, it runs perfectly well under Windows Vista with the .NET Framework installed. In Windows XP, it crashes on load (though the notification area icon appears first):

Screenshot of Facebook Messenger for Windows (XP)

Looking at the executable in .NET Reflector, the program uses the functions DwmSetWindowAttribute and DwmExtendFrameIntoClientArea, which are not available in Windows XP. I suspect that adding support for that operating system wouldn’t be very difficult, however, as the program is little more than a couple of WebBrowser controls (the heavy lifting is not done on the client side).

Given that Facebook decided not to support Windows XP, the least they could do is use a task dialog instead of this:

Screenshot of Facebook Messenger for Windows dialog

If you look closely, you’ll notice that the font is Microsoft Sans Serif, not Segoe UI (the latter is the user interface font in Windows Vista and newer – MS Sans Serif hasn’t been the default since Windows ME!). This is largely Microsoft’s fault – MS Sans Serif is the default font in the Windows Forms designer even in Visual Studio 2010 (and the issue has been around for a long time) – but it’s something that the Facebook developers should have picked up on.

I was disappointed to see that the application is installed to the ‘local application data’ folder (C:Users<User>AppDataLocal in Vista and newer) instead of Program Files. I guess when Google decides it’s acceptable to install Google Chrome in %appdata%, everything is permitted. (Microsoft itself is hardly blameless – ClickOnce applications are installed to somewhere non-standard.)

Interestingly, the developers chose to use the CS_DROPSHADOW window class style to draw a shadow around the window even when the DWM is disabled. Given that Google returns fewer than 10,000 results for CS_DROPSHADOW, this must be one of very few applications to use that feature.

(As the screenshot below demonstrates, running the program with IE7 installed produces hilarious results.)

Screenshot of Facebook Messenger for Windows (Vista)

The program doesn’t respect the operating system’s language settings – the notification area icon’s menu is displayed in the language that the user selects on Facebook.

Finally, the docking functionality is implemented by using an application desktop toolkbar (appbar). I haven’t seen many programs use appbars, so it’s neat to see one in action.

Windows 8: Bypassing the Start screen

After using the Windows Developer Preview (that is, Windows 8 pre-beta) build for a little while, I’m not at all sold on the Start screen as a replacement for the Start menu for keyboard-and-mouse users. I’m not giving up all hope yet, though – I wasn’t overly fond of the Backstage view when I first tried early builds of Office 2010, which similarly replaced what was a simple menu in Office 2007 with a full screen experience, but I’ve since grown to like it. And, of course, development is far from over at this stage.

I’ll be very surprised if I end up using any ‘Metro style’ applications on my desktop or laptop PCs, however. I’m happy to revisit this statement after Windows 8 launches, but the experience does seem much more suited to tablet and phone form factors (and I’d take a traditional PC any day).

There doesn’t seem to be an official way to disable the Start screen, which is not surprising (it would be akin to disabling the ribbon in Office 2007/2010). What is surprising is that it’s actually quite easy to do: just rename shsxs.dll in %windir%System32 and restart (thanks givebackstartmenu): voilà! The highly usable Start menu of Windows 7 returns. It will be interesting to see whether this remains an ‘option’ in future builds. Note that this disables the modern Task Manager, and potentially breaks other functionality, too.

A less radical option is enabling the Group Policy setting ‘Do not show the Start Menu when the user logs in’ (User ConfigurationAdministrative TemplatesStart Menu and Taskbar). This will open the traditional desktop directly after logging in, skipping the Start screen (but leaving it enabled). My initial impression is that this should be the default for non-touch/stylus form factors, but I’ll keep an open mind about that. Unfortunately, this setting isn’t actually working for me (possible PEBKAC). It seems to be connected to a DWORD in the Registry called ‘DontShowStartMenuOnLogin’. Modifying this also has no effect in the Windows Developer Preview.

Office 15: per application border colours?

Winreview.ru’s latest Office 15 screenshots reveal application-specific border colours and drop-shadows. Word gets a dark blue border and shadow, Excel gets a green border and shadow, etc.:

Office 15.0.2703.1000 Borders

Microsoft in fact applied for a patent for per-window glass colourisation in late 2005 (‘Glass appearance window frame colorization’; discovered by Long Zheng in 2007). While there isn’t any glass in the Office 15 windows shown here (despite the DWM being enabled), the idea is similar.

Outlook 15

Office 15 and Windows 8 seem to be moving in similar UI directions – it seems like square corners are in and transparency is out (at least for the ‘Aero Lite’ theme).