What's up with Office 2013's context menu and tooltip shadows?

Update (2015-04-22): Somewhat surprisingly, a recent Office 2013 patch appears to have fixed this issue.

Update (2015-03-04): Office 2016 fixes this.

Update (2014-10-03): Office 2013 running on the Windows 10 Technical Preview (build 9841) exhibits the same issue 🙁

At some point in the not-too-distant past, Office 2013 started rendering strange shadow artefacts in the four corners of all context menus and tooltips:

Screenshot of Word 2013 Context Menu Shadow Artefacts

This didn’t always happen, as a quick search for ‘Word 2013 screenshots’ will reveal lots of images of glitch-free floating windows. I’m too lazy to check, but I’ll hazard a guess that this started happening with Windows 8.1 or Windows 8.1 Update 1.

Being Office, they’ve re-implemented every GUI element themselves instead of letting the OS handle them. One can sympathise with this approach, but it’s important to get the little details right. A bit like how the IE team should finally spend the time to get their scrollbars right. Of course, it’s folly to ever expect UI consistency on Windows when even Microsoft can’t get it right.

A man can dream, though. A man can dream.

Enabling the compatibility property sheet for (almost) all programs in Windows 8/8.1

Windows 8 and 8.1 hide the compatibility property sheet for certain programs (namely programs included with Windows, like Notepad, and those on a whitelist of programs known to run correctly on Windows 8/8.1 – defined in %WinDir%apppatchpcamain.sdb). In some cases, one can still run the ‘troubleshoot compatibility’ wizard by right-clicking on the file, which just presents compatibility settings in a novice-friendly, poweruser-unfriendly way.

The compatibility property sheet and context menu are defined in acppage.dll. By patching this DLL, we can enable the compatibility property sheet for (almost) all programs, including programs like Notepad and those whitelisted in pcamain.sdb.

Patching Windows system DLL files is probably a bad idea, and I take no responsibility if your computer explodes after you take the following steps.

I’ll write a tool to automate this process at some point, but for now, here are the manual steps if you’re feeling adventurous:

  1. Make a backup of acppage.dll from %WinDir%System32
  2. Take ownership of acppage.dll in %WinDir%System32:
  3. Grant administrator users full control over acppage.dll:
  4. Using your favourite hex editor (I like XVI32), overwrite the two bytes at the relevant address to 0x31 0xC0:

    • Windows 8.1 64-bit: 5A92 (the original bytes should be 0x8B 0xC7)
    • Windows 8.1 32-bit: 4B26 (the original bytes should be 0x8B 0xC6)
    • Windows 8 64-bit: 4DBB (the original bytes should be 0x8B 0xC3)
    • Windows 8 32-bit: 3D44 (the original bytes should be 0x8B 0xC6)

    Warning: If the existing bytes don’t match with what I’ve written above, don’t overwrite them! The addresses change with patches to Windows. The above addresses were current as of 2013-09-04.

  5. Restart explorer.exe

Voilà – the compatibility property sheet will appear for most programs now (I’ve noticed that it doesn’t show up for File Explorer):

Screenshot of Notepad.exe and the Compatibility property sheet

How does this actually work?

These two bytes are in the CLayerUIPropPage::Initialize function – this basically does a bunch of checks to determine whether the property sheet should be displayed or not. The original code (0x8B …) sets the return value (the EAX register) to the result of these checks – a non-zero result means the sheet won’t be displayed. We modify the function to always return 0 by using the instruction xor eax, eax (0x31 0xC0).

Windows 8.1 Impressions

Windows 8.1 is done, though Microsoft is apparently worried enough about driver and application support that not even loyal MSDN and TechNet subscribers will get it until October 17 this year. To no-one’s surprise, the RTM ISOs were promptly leaked, which leaves us in the odd situation where the only way to test your programs against the latest version of Windows is to download disc images from shady websites.

My impressions of Windows 8.1 don’t differ much from what I wrote earlier this year when it was still ‘Windows Blue’: no-one who hates Windows 8 is going to be swayed by Windows 8.1, but if you love Windows 8, you’ll probably love Windows 8.1.

For all that’s been written about the return of the Start Button, there are very few concessions towards desktop users in Windows 8.1. Including ‘boot to desktop’ and ‘use desktop background on Start Screen’ as options makes the overall user experience slightly less jarring, but it’s really nothing to get excited about. I highly recommend StartIsBack to restore the Windows Vista/7-style Start Menu. Start Menu programs abound (what does that tell you?), but StartIsBack really feels like it’s part of Windows, not a third-party program.

The biggest change that Windows 8.1 brings to the desktop is improved high DPI support – Windows now supports per-monitor DPI, and no longer requires users to log off in order to change their DPI settings. I’m sceptical about how many applications will bother supporting this functionality, but it’s a nice feature to have.

Given that Windows 8.1 doesn’t offer much to desktop users like me, I might as well write about annoyances introduced with this version.

New annoyances

  • Microsoft has made it hard to create a local account when installing Windows (as opposed to using a Microsoft account to sign in). Windows 8 strongly encouraged you to use a Microsoft account, but Windows 8.1 is worse – the only methods I’ve found to avoid this are to disable network connections or to type in a bogus email address – only then will Windows offer to create a local user account.
  • SkyDrive is now integrated with Windows, but apparently only if you sign in with a Microsoft account (see above). I guess I won’t be using the desktop SkyDrive client anymore.
  • Libraries are hidden by default, and even when they’re turned on, the navigation pane in File Explorer is polluted with shortcuts to the ‘Desktop’, ‘Documents’, ‘Downloads’, ‘Music’, ‘Pictures’ and ‘Videos’ folders (not libraries), as is the main ‘This PC’ (formerly ‘Computer’ – who decided changing that was a good idea?).
  • Unlike some, I don’t hate the default background images (though I question the choice of the orange default image), but the JPEG compression is horrendous. I’m shocked that Microsoft included such low-quality images in Windows.

None of these are show-stoppers, but coupled with the fact that Windows 8.1 offers almost nothing new for desktop users, it’s hard to get excited about this update.

Warning: Simple Storage Spaces in Windows 8 can’t be dismantled

A new feature in Windows 8 is ‘storage spaces’, a kind of software RAID, similar to the drive extender functionality found in the defunct Windows Home Server. Unlike Windows Home Server, however, Windows 8 provides no means of removing hard drives from simple (no resiliency) storage spaces, even when there’s adequate free space. Deleting the storage space will remove all your data, so you’ll need to copy everything to other storage devices first. If all your hard drives are being used by the storage space, this can be tricky.

My home server has recently decided to reset itself at random intervals (no errors to speak of), possibly due to an incompatibility between some piece of hardware and Windows 8 (or possibly just a failing piece of hardware). I’d like to try re-installing Windows 8 to see if that helps, and try Windows 7 if it doesn’t, but first I need to find a way to transfer about 8TB of data from my storage space.

Moral of the story: don’t use simple storage spaces if you ever plan to dismantle them.

Theme Colours in Windows ‘Blue’

As I noted in my earlier post, the method for selecting theme (‘accent’) colours in Windows ‘Blue’ build 9364 has changed from Windows 8 RTM. I’m not going to bother looking too closely at the updates to the functions in UxTheme.dll this early in the development process, but I did notice two new registry values in the key HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAccent: ‘AccentColor’ and ‘StartColor’. These are DWORD values that store the accent colour and background colour, respectively. The format is 0xAABBGGRR. The old ‘ColorSet_Version3’ value from Windows 8 is gone for obvious reasons. ‘AccentId_v8.00’ from Windows 8 is now ‘MotionAccentId_v1.00’, but it seems to serve the same purpose – indicating which background image is selected.

Windows ‘Blue’ Build 9364 Observations

Update (2013-04-21): the thin borders are all gone in build 9374.

It looks like Microsoft isn’t changing tack with the next release of Windows – the recently leaked build 9364 of Windows ‘Blue’ contains a bunch of worthwhile changes to the Modern/Metro/Immersive environment, but the desktop seems to be basically untouched from Windows 8. If you hated Windows 8, you’ll probably hate Windows ‘Blue’. If you’re ambivalent, like me, about Windows 8, you’ll probably feel the same way about Windows ‘Blue’. I don’t think I’ve met anyone who loves Windows 8 outright, but that person will love Windows ‘Blue’.

Screenshot of Windows 'Blue' Clock

The only UI changes on the desktop that I’ve spotted so far are related to window borders – the borders of the clock and action centre pop-up windows are now 1 pixel wide (and the windows are set 16 pixels from the edge of the screen/taskbar). The volume control retains the Windows 7/8 look (fat borders, 8 pixel margin). Continuing on the theme of window borders, certain windows have thin (~3 pixel) borders, as shown below. I’m not sure what window styles cause this effect, but the same thing happened in pre-release Windows 8.

Screenshot of Windows 'Blue' Window Borders


On the Modern-Desktop integration front, bringing up the ‘Share Charm’ now has options for sharing a screenshot of the desktop (though I can’t get this to work) and for opening SkyDrive. That’s about it.

The method of selecting theme accent and background colours has changed significantly, and it seems like that post I wrote about the GetImmersiveColor* functions will be obsolete soon. It’s now possible to select basically any colour combination (see below), which makes it quite easy to get unreadable text. Too much choice can be a bad thing, and I prefer the Windows 8 approach of a limited set of colour combinations that have been tested thoroughly to make sure all text is readable.

Screenshot of Windows 'Blue' Personalisation


It will be interesting to see how quickly this version is pushed out the door. I’m quite surprised to see the version number bumped up to 6.3 (Windows 8 is 6.2), which could indicate that this will be a bigger release than many had assumed. It would be nice if the desktop got a bit more attention, but I’m not holding out hope. In this early build of Windows ‘Blue’, none of my pet issues are solved (ClearType missing from text drawn on opaque surfaces for no reason, unnecessary Modern UI encroaching on the desktop for network settings and ‘open with’ dialogs, etc., no Windows Update notifications on the desktop, Modern UI scrollbars in desktop IE, and so on and so forth).

Windows Update Notification Tool for Windows 8

I was apparently part of the 5.82% of Windows 7 users who preferred to be notified about updates rather than have them installed automatically. Annoyingly, Windows 8 no longer displays the familiar balloon tip and notify icon when new updates are available, instead placing a notice on the lock screen (which I almost never have occasion to see on my desktop). I found this frustrating enough that I decided to write a small unmanaged program to mimic the basic functionality of the old notify icon. It also supports automatic installation of specified updates (identified by their Knowledge Base ID – I use this to install Windows Defender definition updates). You can find out more and download the tool here:

Windows Update Notification Tool

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 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 

Office 2013: Further Evidence of the Demise of ClearType?

Poking around the Office 2013 Customer Preview, one thing that caught my eye immediately was the lack of ClearType font smoothing. Nearly all user interface elements use ‘greyscale’ font smoothing (as opposed to ClearType’s sub-pixel smoothing). I’ve highlighted the parts of Word 2013 that still use ClearType:

Screenshot of ClearType in Microsoft Word 2013Screenshot of ClearType in Microsoft Word 2013

The text in cells in Excel 2013 still respects the system’s ClearType setting, and Outlook 2013 is a real mess (about half-and-half). OneNote 2013 seems to have retained ClearType in most places (outside the ribbon control).

Long Zheng earlier noted the absence of ClearType from the Metro environment and there are several possible reasons for it falling out of favour at Microsoft. Sub-pixel anti-aliasing isn’t necessarily suited to tablets that need to support multiple orientations (unless different sub-pixel orderings are taken into account), and screens with high pixel densities can get away with greyscale font smoothing.

I fear that this is another case of the tablet tail wagging the Microsoft dog – desktop and laptop users of Office 2013 (and Metro-style apps in Windows 8) will have to deal with lower quality text due to the new hardware Microsoft is targeting with its upcoming releases.

The Office 2013 Customer Preview is, of course, just that, and things might change before RTM. Regrettably this wasn’t fixed for the Office 2013 RTM.