Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS
with no warranties, and confer no rights. Additionally, views expressed
herein are my own and not those of my employer, Microsoft.
A couple of weeks ago, I posted an item describing how to add up to 2 custom strips to the Windows Media Center Start menu with up to 5 tiles each. As I was working on the examples for that blog post, I noticed an annoying behavior - when creating a strip with multiple tiles, the tiles seemed to appear in a random order from left to right within the strip.
After talking to a couple of developers and looking at some of the code, I found out that it is possible to control the order of the tiles in a custom strip, but it is non-intuitive to say the least. To help folks combat this non-intuitiveness I'm going to post this blog post and this information will be included in a future build of the Windows Media Center SDK as well.
The following registry value is used to sort the tiles based on the order in which they were installed, and then Windows Media Center selects the first 5 tiles that it finds based on the order that they were installed (from oldest to newest), and displays them as tiles in the custom strip on the Start menu:
The tricky part here is that if the TimeStamp value is the same for multiple entry points (tiles), then the sort order is indeterminate. This is compounded by the fact that if you register your application using RegisterMceApp.exe or the RegisterApplication API, the TimeStamp values will nearly always be set to identical values because the operations that this EXE and API perform are fast enough to complete within a second.
In order to control the exact order that tiles appear in a custom strip that you add to the start menu, you will need to modify the TimeStamp values to be unique and sequential so that the tile you want to appear on the far left has the smallest TimeStamp value and the tile you want to appear on the far right has the highest TimeStamp value.
The easiest way I have found to accomplish this is the following:
In order to demonstrate this concept, I have updated the Start menu customization example to include a registry file named TestApp1Ordered.reg.
If you register TestApp1 as a custom strip using these instructions and then launch Windows Media Center, you will see the tiles listed in a non-sequential order. If you then merge in TestApp1Ordered.reg to your registry and restart Windows Media Center, you will see the tiles displayed in sequential order from left to right.
If you look at TestApp1Ordered.reg in a text editor such as Notepad, you can see that I use the baseline value of DWORD:0c7e59da for Entry Point 1 and then increment this value by 1 for each subsequent entry point.
Please note that I listed the HKEY_CURRENT_USER versions of the registry values in TestApp1Ordered.reg, so if you register the application for all users, you will need to update the syntax of TestApp1Ordered so that it works correctly.
A couple of additional notes:
If you are planning to create an MSI package to install your Windows Media Center application (which I strongly recommend as a ship vehicle for your application!), then you can directly add TimeStamp registry values in sequential order in the Registry table of the MSI to control the placement of tiles in your custom strip.
I have previously written blog posts describing how to add up to 2 custom strips to the Windows Media
This article will serve as a central repository for topics that I have written about Windows Media Center