The First Non-OEM Static Windows Mobility Center Tile

committed to database on December 21, 2007 at 2:27 am Eastern Standard Time 15 comments digg this

Made by Long ZhengIn April, Long Zheng brought more attention to a neat applet within Windows Vista called the Mobility Center. It wasn't until recently, however, he ranted to me about its continued lack of attention by ISVs and challenged me to a) figure out how tiles work and b) create a tile myself.

After some preliminary Google querying, I came across specific implementation information in the Windows Vista OEM Preinstallation Kit, WindowsMobilityCenter-OEMDeployment.rtf to be specific (pdf'ed for shrinkage purposes). Upon glance, you'll notice the acronym OEM plastered everywhere. Mobility Center's extensibility, sadly, was designed solely for OEM use.

Volume TileAs you'll read in the document, there are two types of Tiles. Static and Dynamic. Static Tiles contain an icon, a line of text, a control (button, slider, or drop-down) and its name at the bottom. Nothing more, nothing less. Dynamic Tiles contain all the properties of a Static Tile but also offer the ability to 'refresh' the Tile live, programatically, enhancing the UI experience at the expense of code complexity (i.e. the Volume Tile).

Long's request, thankfully, only necessitated the creation of a Static Tile which only requires a hand full of code. Dynamic Tiles force developers into the fiery depths of COM of which I'll get into at some other time.

Following the guide, I created the necessary registry keys, assigned them values pointing to string and icon resources in my executable, and wrote some code to shut off the display. (If you're a developer and wondering why I didn't just hackishly send a window message to my desktop or all the windows on my desktop with three lines of code, read this article now).

Bare minimum registry tinkering required:

  • TileOrder (REG_MULTI_SZ)
  • OEMName (REG_EXPAND_SZ)
  • Tile registry values (REG_EXPAND_SZ)
    • TileName (pointing to string resource)
    • Icon (pointing to 32x32 and 48x48 icon resource)
    • StatusText (pointing to string resource)
    • ButtonAction (command to execute)
    • ButtonLabel (pointing to string resource)
  • RunOnDesktop (REG_DWORD), to enable use of Mobility Center on non-mobile platforms.
    (must be on supported Windows Vista SKU)

Before you go off creating your own tiles, swamping machines with your viral Tiles, I must emphasize the following points:

  • The OEMName registry value should not be blindly overwritten by your registry script or Tile installation routine. Doing so can render Tiles missing in action and/or show unwanted text in the Mobility Center.
  • The text Customized by is hard-coded. Again, Mobility Center's extensibility was designed for OEM use, therefore a company name would normally proceed. My Display Off Tile contains the text resource "various third parties" to keep it open for third party use.
  • I am developing a management utility of sorts to allow independent developers to put out their own Tiles without having to worry about duplicating my OEM Tile detection logic, manipulate the tile order, write an installer, etc. I'm looking for suggestions and comments in this area (i.e. should I mimic .Gadget files?)
  • Read the documentation.

Oh, and you can download MSIs for the x86 and x64 platforms too.

  1. murphy December 21, 2007 at 5:23 am

    Is it possible that you can publish the complete source, for looking other developers in the source as example? Would be really cool. Thanks for the great tile. My Notebook got it already ;)

    Cheers, murphy

  2. Rafael December 21, 2007 at 7:39 am

    Sure, I’ll do that tonight.

  3. Singh400 December 21, 2007 at 1:50 pm

    Ooooo nice. Briiliant work!

  4. Billy2007 December 21, 2007 at 6:30 pm

    this is soo cool, i have this tile installed on my desktop, oh, if you go to http://www.istartedsomething.com, there is a .reg file released to make WMC work on desktops too, and then you can use this tile,

    i sure hope they bring out more tiles for it.

  5. martin December 31, 2007 at 11:19 am

    Where is the source?

  6. murphy January 3, 2008 at 5:01 am

    Still looking for the source? Luke are you there ;) ?

  7. Rafael January 3, 2008 at 4:18 pm

    murphy, sorry for the delay. The holidays induced lethargy, causing me to sit on my ass and do nothing. I’ll get it up sometime tonight, promise. Do you develop 0irc?

  8. murphy February 12, 2008 at 4:56 am

    “Do you develop 0irc?” – Yes, i’m the maintainer/developer… I’m way behind on uploading my sourcecode to my website :(

  9. Scott W. Kurth March 20, 2008 at 8:32 pm

    I should add that your mileage may vary based on the assumptions I made about device ids for your Bluetooth device. There is no warranty implied, explicitly stated, etc. This won’t willy-nilly start disabling random devices on your machine, but it does look for all devices of type “Bluetooth” with ids that begin with USB. Good luck.

  10. roofing company September 13, 2008 at 2:58 pm

    my mileage would only cover lonon to swansea

  11. paul timmerman November 7, 2008 at 9:56 am

    when i use my stylus to hit the off button, the screen blinks off and then back on again. when i use my mouse to hit the off button everything works fine. any ideas?

  12. arramnloojere March 31, 2009 at 5:47 pm

    Слу, да как ты вобще до такого додумался?

  13. Alberto April 6, 2009 at 5:08 am

    Hi Rafael,
    I need to develop a dynamic tile with MFC, is possible to do this? I can’t find an example code for dynamic tile.
    Regards

  14. erorsesty April 22, 2009 at 8:00 am

    emm… attractive ))

  15. Karun September 12, 2009 at 6:08 pm

    Is this tile working fine on Win7 for anyone? Its either this tile or the ones that Dell update added to WMC but WMC is freezing now. Any ideas on how to remove tiles?