Compartir a través de


Sample code for launching Windows Media Center and browsing to a specific experience

A couple of weeks ago, I posted a description of an algorithm that can be used to launch Windows Media Center and automatically browse to a specific experience.  At the end of that post, I mentioned that I was working on a Win32 sample application to demonstrate this algorithm.  I've gotten this sample implemented, code reviewed and tested and it is ready to post for download in case you are interested in seeing an example of how the algorithm can be implemented.

You can download the example code and a compiled EXE from https://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog%5E_Tools/LaunchMce.zip.

This example contains UI that lets the user select a Windows Media Center page ID from a drop down combo box and select the mode to use when launching Windows Media Center.  It performs a version check to make sure that the system the application is run on includes at least Windows Media Center 2004 (the first version that this method of launching Windows Media Center was supported in).  It also includes a command line mode that allows you to pass in the page ID and launch mode and run the application silently.

Hopefully this helps you get started if you are interested in implementing this algorithm for launching Windows Media Center as a part of your application.

<update date="3/8/2010"> Fixed broken link for the sample code. </update>

Comments

  • Anonymous
    January 14, 2009
    PingBack from http://blogs.msdn.com/astebner/archive/2006/09/28/776362.aspx

  • Anonymous
    July 26, 2010
    The comment has been removed

  • Anonymous
    July 30, 2010
    The comment has been removed

  • Anonymous
    August 17, 2010
    Hi Aaron, sorry for the late response (vacation). For an embedded scenario we need to use /nostartupanimation /noshutdownui /mediamode We want MC to start without the startupanimation and navigate directly into our own Plugin. We could use /entrypoint with ehshell.exe to navigate to our plugin, but we think the WPARAM = 13 method is still the only reliable supported way. but if you also have no idea, i guess we have to go the ehsehll.exe + switches approach. Regards, Dan#

  • Anonymous
    August 17, 2010
    Hi DanB_DE - Those scenarios make sense to me but unfortunately I don't know of a way to combine those switches with the functionality to launch Media Center to a specific page.  However, I have not been on the Media Center team for a few years, so there might be a way to do this that I'm not aware of.  You may want to try to contact Microsoft Developer Support to see if they have any options that they can suggest.  You might also want to post a question on one of the following forums: thegreenbutton.com/.../ShowForum.aspx www.microsoft.com/.../reader.mspx

  • Anonymous
    September 02, 2010
    Hello Aaron, thx for your Feedback and Help. i found the following Reg-Key (and more). With this Key its possible to use the WPARAM algorithm and using Reg Keys instead of cmd switches. Windows Registry Editor Version 5.00 [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionMedia CenterSettingsMCE.PerUserSettings] "enableStartupAnimation"=dword:00000000 "enableStartupSound"=dword:00000000 Greetings, Daniel

  • Anonymous
    September 02, 2010
    Hi DanB_DE - Please keep a couple of things in mind with this registry key:
  1.  It is under HKEY_CURRENT_USER, so if you have scenarios where multiple users will log onto the same computer, you'll need to also configure the keys under HKEY_USERS.Default so that the new users will get the settings as well.
  2.  Like with anything that isn't officially documented, it is subject to change in future updates or new versions of the product without warning.  You'll want to do compatibility testing as new Media Center updates and new versions of Media Center are released to verify that your scenarios continue to work.