The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Custom Start Menu Strip Problems...

Last post 08-15-2008, 4:18 PM by James. 10 replies.
Sort Posts: Previous Next
  •  08-04-2007, 11:31 PM 4128

    Custom Start Menu Strip Problems...

    I'm generating a custom Start menu strip, and have encountered a couple of problems.

       a) Directed at Charlie/Microsoft: Why do they only let you have 5 tabs? It's an odd, arbitrary number. Surely the plan should be 'one, or unlimited' shouldn't it?

       b) Please check the following link - http://msdn2.microsoft.com/en-us/library/bb189039.aspx that discusses custom Start menus and how to re-order them. A couple of points...

          Firstly, the registry key these items are supposed to be under doesn't exist when I tinker around in Regedit, although it does appear under  HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\<custom start menu>

           Is this seperation between the default user settings and the Local Machine settins something to do with Vista/User Account Control, or should the documentation should be corrected?

       c) Finally, I have found that changing the timestamp seems to do nothing to the order of the entries in the menu. I've tried changing the timestamp in the above directory, and also in the actual Entry Point decleration, but nothing I do seems to change the order of the entries.

       d) If we are to always use RegisterMCEApp to register our addins, because the structure of the app registration may change in the future, why do we need to edit the registry to change their order? Surely there should be something like an 'orderoffset' in the XML file to allow us to specify a preferred order of our addins? We need ONE technique to do everything, rather than have a situation where we have a 'suggested' technique that requires you to sometimes use the one that Microsoft is telling us NOT to use.


    100 downloads a day for Yougle Vista - goin' allright!

    Check out http://www.thedigitallifestyle.com/cs/Blogs/developer/default.aspx and http://www.push-a-button.com.au/products/mce
  •  08-05-2007, 1:39 PM 4135 in reply to 4128

    Re: Custom Start Menu Strip Problems...

    My recollection is that it is the GUID that determines the order, not the timestamp -try swapping round two of the GUIDs and see if that influences the order they are displayed.

    Cheers,
    Andrew

     

  •  08-06-2007, 10:23 AM 4137 in reply to 4135

    Re: Custom Start Menu Strip Problems...

    The GUID does not determine the order -- the timestamp does. IgnoranceIsBliss, I'll have more details for you later this week -- working on some better docs.
    Charlie Owen (Microsoft)
  •  08-07-2007, 4:08 PM 4153 in reply to 4137

    Re: Custom Start Menu Strip Problems...

    OK - I found that one of the problems is that I was not registering the thing as All Users, I was instead only registering the app for the single user. Definately partly my fault, but perhaps we can point this out in the documentation by saying that 'for all users, it will be under this key, for a specific user, under this one'.

    Once it is in the place you expect, changing the timestamp does change the order, but I would like to re-state that I think we should include a TimeStampOffset or something similar in the registration XML file.

    Also, I believe that having the Start menu strips appearing in DESCENDING order (eg. highest timestamp first) and the ITEMS in those menus appearing in ASCENDING order (oldest first) is a little awkward - perhaps we can work with just ONE method in the future?


    100 downloads a day for Yougle Vista - goin' allright!

    Check out http://www.thedigitallifestyle.com/cs/Blogs/developer/default.aspx and http://www.push-a-button.com.au/products/mce
  •  08-07-2007, 5:04 PM 4160 in reply to 4135

    Re: Custom Start Menu Strip Problems...

    My experience is that the timestamp values control the left-to-right order of tiles in strips.  You can check out the .reg files in C:\Program Files\Microsoft SDKs\Windows Media Center\v5.0\Samples\Register Application for examples of the registry formatting.  After registering Application1 on my test system, I have tried changing the ordering of the following 5 timestamp values in Registry.Application.1.reg and then re-starting Media Center and it causes the tiles in the custom strip to appear in different orders:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\MyCompany\MyApplication1\{e59f52ca-5440-41d3-aabf-d4e1ba53add4}]
    "TimeStamp"=dword:0CC919AF

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\MyCompany\MyApplication1\{29b8fe49-3741-469c-8d45-abc927ffbbd8}]
    "TimeStamp"=dword:0CC919B0

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\MyCompany\MyApplication1\{97de531e-9a8a-4faa-9f1f-bbb12fe70626}]
    "TimeStamp"=dword:0CC919B1

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\MyCompany\MyApplication1\{f5300c25-acc0-4854-b659-f71002dba97d}]
    "TimeStamp"=dword:0CC919B2

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\MyCompany\MyApplication1\{9ba5d566-8c2a-4bc1-b248-2f93a478b5be}]
    "TimeStamp"=dword:0CC919B3

    You do need to make sure to stop and restart Media Center before any registry changes will take effect (in case you hadn't tried that previously - I have gotten burned by forgetting about that in the past).

    To address a couple of your other comments - I don't have a good answer about why a strip is limited to 5 tiles.  I wasn't a part of that decision but I think it mostly revolved around limiting visual clutter - 5 tiles will appear in the Media Center start menu when it is run in 16x9 mode without any left/right scrolling being needed to view all of the tiles.  It is also pretty rare for an application to need more than a couple of entry points, and we did not want all applications to add themselves to the start menu and clutter things visually.

    You are right about the discrepancy between using RegisterMceApp for application registration and yet needing to directly edit the registry to change the order of tiles.  Ideally, there would be an option to control this in the registration XML file, but unfortunately that scenario wasn't discovered until it was too late to add for Windows Vista Media Center.  For now, if you require specific ordering of tiles in a custom strip, you will have to modify the registry directly.  However, most cases we've seen don't require specific ordering so hopefully this will be a rare scenario.

    If you do need to do this, you will have to create a separate installer for 32-bit and 64-bit because a 32-bit MSI will by default will create registry keys in the WOW64 registry hive, and the 64-bit version of Media Center does not look in the WOW64 hive for this application registration information because it is running as a native 64-bit application on a 64-bit OS.

    I am working on an example for creating separate 32-bit and 64-bit installers for Media Center applications to help address this scenario.  I'll post it on my blog (http://blogs.msdn.com/astebner) once I am done testing my setup authoring.

    Thanks!  Aaron

  •  08-07-2007, 8:31 PM 4161 in reply to 4160

    Re: Custom Start Menu Strip Problems...

    There were a lot of usability studies done to determine the optimal number of items on any particular strip + the overall number of strips possible. Five seemed to be the best balance of usability for the end user and entry points for any single application installation.

    The original intent of the start menu strips was for OEMs in a preinstall environment where writing the registry keys for a single image is no big deal. That is still the primary purpose of these strips. You should carefully consider the need for a custom Start Menu strip before implementing. Although we have five features in the Z sample application (Movies, Music, TV, Downloads and Search) we elected to NOT implement a custom Start Menu strip -- mostly because those features would compete (at least in name) with the built in Windows Media Center features and potentially cause confusion for users.

    I would love to hear feedback on exactly how folks are using custom Start Menu strips for future platform consideration.
    Charlie Owen (Microsoft)
  •  08-07-2007, 9:48 PM 4167 in reply to 4161

    Re: Custom Start Menu Strip Problems...

    The original plan (and I had written all of the code quite successfully until discovering the 5-entry-point limitation - that'll teach me to RTFM!) for Yougle Vista was to have each source appearing in the 'Web Video' start menu strip.

    This would make it very simple for the user to go directly to 'MSN Soapbox' for instance - they just pick their preferred source straight off the start bar.

    With the limitation of only 5, I've had to rebuild my interface over the last day or so, because I wasn't anticipating having to make a 'source selection' dialog.

    In the end though, I have - and I've used the start menu strip instead to have 'Choose Source', 'Most Popular Source', 'Popular Movies', 'Featured Movies' and 'Start & Stop Recording' buttons.

    Because 'Choose Source' was by far the most important of these, it MUST be the first in line, with 'Start & Stop Recording' (which you only turn off if the download is consuming too much of your bandwidth) being the last. This is why order and position was vital to me - for some reason, it kept putting the recording option FIRST.

    I'll be first to admit that very few applications really would need more than 5, but of course (and it seems to be a special talent with this particular project and Media Center development), Yougle is special :)


    100 downloads a day for Yougle Vista - goin' allright!

    Check out http://www.thedigitallifestyle.com/cs/Blogs/developer/default.aspx and http://www.push-a-button.com.au/products/mce
  •  08-15-2008, 11:29 AM 8101 in reply to 4167

    Re: Custom Start Menu Strip Problems...

    Ok, so it seems clear to everyone else but I seem to be missing something in the docs.  If I have a custom menu strip for 3 items how do I get each item to actually load a different page in my assembly plugin?  All of the samples I've found use online mcml pages and the docs either don't say or they are just hiding it from me

  •  08-15-2008, 12:35 PM 8104 in reply to 8101

    Re: Custom Start Menu Strip Problems...

    This is how I've done it; but I do seem to recall discussing other ways also - check my posts from a year ago or so :)

    namespace myAddIn
    {
      public class addIn:IAddInModule, IAddInEntryPoint
      {
        private string _id;

        public void Initialize(Dictionary<string, object> appInfo, Dictionary<string, object> entryPointInfo)
        {
          _id = entryPointInfo["id"].ToString();
        }

        public void Launch(AddInHost host)
        {
          s_session = new HistoryOrientedPageSession();
          Application app = new Application(s_session, host);

          switch (_id)
          {
            case "{00000000-0000-0000-0000-000000000000}": //1st guid
              _gotoPage = "First";
              break;
            case "{00000000-0000-0000-0000-000000000000}": //2nd guid
              _gotoPage = "Second";
              break;
            .....
            default:
              break;
          }

          app.gotoPage(_gotoPage);
        }
      }
    }


  •  08-15-2008, 3:56 PM 8105 in reply to 8104

    Re: Custom Start Menu Strip Problems...

    This seems to work, thanks!

     

    Funny, I'd have though a cleaner solution would be at hand.

  •  08-15-2008, 4:18 PM 8106 in reply to 8105

    Re: Custom Start Menu Strip Problems...

    Translucent:

    Funny, I'd have though a cleaner solution would be at hand.



    The intention is that you'd use the Context attribute on the entry points to pass in the contextual data:

        <entrypoint
            ...
            context="whatever"
            ...
           />
        </entrypoint>

    And in your code:

        string context = "";

        if (AddinHost.Current.ApplicationContext.EntryPointInfo.ContainsKey("Context"))
        {
            context = (string)AddinHost.Current.ApplicationContext.EntryPointInfo["Context"];
        }

        switch (context)
        {
             case "whatever":
                 // do something
                 break;
             default:
                 // do something else
                 break;
        }

    I'm not sure that qualifies as "cleaner" (I've got a wealth of issues with the whole entry point area of the API), however it's the approved™ method.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems