Browsing to a Specific Page

Windows Media Center exposes a way for third-party applications to launch Windows Media Center and browse to a specific set of pages. This process works regardless of whether the Windows Media Center user interface (UI) is currently running. This process also brings the Windows Media Center UI to the foreground.

This process is the only supported mechanism of browsing to the Windows Media Center UI from a third-party stand-alone application, and was first made available in Microsoft Windows XP Media Center Edition 2004.

To browse to the Windows Media Center UI, the third-party application must do the following:

  1. Call the Win32 FindWindow API, passing "Media Center Tray Applet" for the class name and NULL for the window name.

  2. If the FindWindow API returns NULL, run %windir%\ehome\ehTray.exe with the /nav:X command-line parameter, where X is the WPARAM value from the table below.

  3. Call the Win32 RegisterWindowMessage API passing "Media Center Navigate To Page", and then save the result.

  4. Call the Win32 SendMessageTimeout API passing the window returned in step 2, the message registered in step 3, and the appropriate values for the WPARAM and LPARAM parameters from the tables below.

    WPARAM values for browsing:

    Windows Media Center page WPARAM value
    Windows Media Center Start Menu WPARAM = 0
    Live TV WPARAM = 1
    TV Guide WPARAM = 2
    My TV WPARAM = 3
    Recorded TV WPARAM = 4
    My Music WPARAM = 5
    My Photos WPARAM = 6
    Schedule Recordings WPARAM = 7
    My Videos WPARAM = 8
    Radio WPARAM = 9
    Online Spotlight (only for Update Rollup 2 for Windows XP Media Center Edition 2005 and later) WPARAM = 12
    Extensibility application (only for Update Rollup 2 for Windows XP Media Center Edition 2005 and later) WPARAM = 13

    LPARAM values for browsing:

    Startup state LPARAM value
    Start Windows Media Center in the last used state (full screen or windowed) LPARAM = 0
    Start Windows Media Center full screen LPARAM = 1

    New values may be added in future versions of Windows Media Center.

  5. If the SendMessage API returns a non-zero value, the browse failed.

See Also