Category: Programming

  • Pixel-perfect Multi-DPI Images in WPF (Part 1)

    View source on GitHub. See also: Part 2 and Part 3. I’ve written previously about DPI-awareness in the Windows Presentation Foundation and how to specify measurements in pixels rather than Device Independent Units (DIUs). Something else to consider is image scaling – unlike the Windows Ribbon control or WinRT, WPF has no in-built mechanism for…

  • P/Invoke and ChooseFont (Comdlg32.dll)

    Mister Goodcat wrote a good article a little while ago about using P/Invoke in Silverlight 5 to display the native font chooser dialog with the ChooseFont function. I couldn’t get the code working for a 64-bit executable, however, as the definition of the CHOOSEFONT structure on MSDN he used as a basis for the managed…

  • Windows 8 Theme Colours Reference

    In a similar vein to my Windows System Colours Reference, I’ve compiled a Windows 8 Theme Colours Reference using the APIs I wrote about in the previous post.

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

  • Windows 8 Release Preview Updates

    I’ve belatedly updated my Windows System Colours Reference and post about Segoe UI to reflect changes in the Windows 8 Release Preview.

  • Keiki Usage Meter 3.1.0 Released

    I’ve released an update for Keiki Usage Meter. There has been a lot of behind-the-scenes work, but the user experience hasn’t changed drastically. Visit the website to find out what’s new. I’m using this program as something of a testbed for some engineering work that I’ll talk about in future posts, including supporting pixel-perfect bitmap…

  • WPF: Using System Colours in Animations

    WPF provides access to the Windows system colours through the System.Windows.SystemColors class. As the MSDN documentation indicates, it’s possible to bind to these colours dynamically using the *Key resources, so when the system colours change, so will the appearance of your application. This code will set the colour of a TextBlock to the ‘GrayText’ system…

  • Windows System Colours Reference

    I’ve put together a reference of Windows system colours from Windows XP to the Windows Developer Preview (and I’ll update it when the Windows Consumer Preview is released in the near future). Check it out here.

  • Drawing non-themed push buttons in Windows

    When visual styles are enabled in Windows, one may use the DrawThemeBackground function to draw themed push buttons. However, users of Windows XP, Windows Vista and Windows 7 can disable visual styles by selecting the Windows Classic theme or one of the High Contrast themes (and in Windows 2000 and earlier, visual styles weren’t available…

  • 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.…