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

Invoking the photo wall?

Last post 09-08-2009, 3:55 PM by eddyc. 4 replies.
Sort Posts: Previous Next
  •  05-13-2009, 4:49 AM 9226

    Invoking the photo wall?

    Has anyone figured out how to invoke the shiny new photowall slideshow in Windows 7 from within a plug-in?

    I can get the standard slideshow up okay with NavigateToPage / PageId.Slideshow, and pass in the path to my preferred slideshow folder, but I'd like to be able to display the photo wall.

    (The photowall is the one that appears by default under Photos & Videos -> Favourites on the start menu, where the display pans around and zooms in & out of an entire wall filled with photos.)

    Thanks,

    Eddy

  •  05-14-2009, 2:23 PM 9227 in reply to 9226

    Re: Invoking the photo wall?

    eddyc:
    Has anyone figured out how to invoke the shiny new photowall slideshow in Windows 7 from within a plug-in? I can get the standard slideshow up okay with NavigateToPage / PageId.Slideshow, and pass in the path to my preferred slideshow folder, but I'd like to be able to display the photo wall. (The photowall is the one that appears by default under Photos & Videos -> Favourites on the start menu, where the display pans around and zooms in & out of an entire wall filled with photos.) Thanks, Eddy

    There is no way to invoke that programmatically.

    If you really want to, you can try the screensaver interface for the windows screensaver but you have to make sure that media center is in full screen and setup the media center picture screensaver settings through the registry, to have the picture wall auto launch.

    Alternatively, navigate to start menu, then do a default action (through IAccessible interface) on the "Play All" button under the Pictures strip.

    Yes I admit these methods are not pretty.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    David Teo
    SDET
    Microsoft Corporation
  •  05-14-2009, 4:52 PM 9228 in reply to 9227

    Re: Invoking the photo wall?

    Thanks for the follow-up David. I hadn't considered using iAccessible, but this might be a fairly robust approach that will sort out one or two other problems for me too. I'll give it a try.

    (Obviously, it would be nice to have a more direct way to get to the Photowall, so hopefully it's now on the wishlist for Windows 8...)

    Eddy

  •  05-23-2009, 3:14 AM 9231 in reply to 9228

    Re: Invoking the photo wall?

    For the benefit of anyone else following this thread, I ended up going with the ScreenSaver approach, which is working fine. It relies on the screensaver not being disabled, but that's okay for my application.

    I had trouble getting IAccessible to work, and there is some discussion in other forums about stability issues when accessing it from C#, so it seemed like more work than the end result would justify.

    Here's the code snippet I'm using to invoke the wall:

    [DllImport("User32.dll")]
    public static extern int SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

    [DllImport("User32.dll")]
    public static extern int PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

    const int WM_SYSCOMMAND = 0x0112,
    const int SC_MAXIMIZE = 0xF030
    const int SC_SCREENSAVE = 0xF140;
    const int HWND_BROADCAST = 0xFFFF

    Process[] localByName = Process.GetProcessesByName("ehshell");

    // Make Media Center fullscreen (does nothing if already full screen)
    SendMessage(localByName[0].MainWindowHandle, WM_SYSCOMMAND, (IntPtr)SC_MAXIMIZE, (IntPtr)0);

    // Invoke screen saver
    PostMessage(new IntPtr((int)SpecialHandles.HWND_BROADCAST), WM_SYSCOMMAND, (IntPtr)SC_SCREENSAVE, (IntPtr)0);
  •  09-08-2009, 3:55 PM 9336 in reply to 9231

    Re: Invoking the photo wall?

    I just noticed that Microsoft.MediaCenter.UI.Accessibility has a public IAccessible class, which seems to be a C# mapping onto the usual IAccessible stuff. It's not documented in the SDK, however.

    Has anyone played with this? If it provides a more straightforward interface to the IAccessible information within Media Center, it would be very helpful indeed.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems