Should Mp be The Display-Aware Application (1 Viewer)

te3hpurp

Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    As M$ describes it. ;)

    This popped into my mind one day. Methology explained here:
    The Display-Aware Application (Windows)

    It's basically detecting when monitor is disconnected.
    I mean could this be used for correcting problems with Win7, when powering off Tv and back on.

    For me at least part of desktop is displayed on one side or in bottom of the screen. Of course
    it could be used other things too, like closing everything that is playing, for example calling g_player to stop.
    Different scenarios for behavior when display is closed should be able to set in configuration.

    It's basically detecting WM_DISPLAYCHANGE message in Mediaportals WndProc(), which allready is there. WM_DISPLAYCHANGE os hex 0x007E.

    Regards,
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Hi.
    In case someone is interested
    I tested a bit.

    Code:
        if (msg.Msg == 0x007E)
        {
            if (g_Player.Playing)
            {
                g_Player.Stop();
            }
            if (!windowed)
            {
                int y = (msg.LParam.ToInt32() >> 16) & 0xFFFF;
                int x = (msg.LParam.ToInt32() & 0x0000FFFF);
                this.Height = y;
                this.Width = x; 
                this.Location = new Point(0, 0);
            }
        }

    in Mediaportal.cs in wndproc, gives the result that i wanted in Win 7. When i turn off/on my tv,
    Mp now corrects itself to fill the whole screen.

    In real life 0x007E should be defined as WM_DISPLAYCHANGE message etc. And probably there is
    something else in Mp Gui programming that needs to taken into account, I just don't know it.;)

    regards,
     

    Users who are viewing this thread

    Top Bottom