[fixed] MPTray not setting focus (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    If I use MPTrayMod (MEDIAPORTAL - free media center - MpTrayMod) on 1.1 RC1 then MP gets focus correctly.

    If I use the version bundled with 1.1 RC1 I get the task bar taking focus and I have to either press TGB again (which annoying switches between basic and standard homes) or I have to click on MP with the mouse which is hardly ever to hand.
     

    trythisone

    Portal Member
    April 13, 2008
    16
    2
    Home Country
    MpTrayMod attempts to set the focus once a second for up to a minute or until it succeeds. When it was integrated with media portal they choose to comment this code out.
    Given that its now integrated, it could be better implement using the AppDomain class as this should be quicker, and allow access to media portals methods thus removing the need for the native method imports.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I found a sort of solution but don't know if this could be incorporated.

    If I select the desktop before pressing TGB it works everytime. Is it possible to get MPTray to focus on the desktop first and then do whatever it does??
     

    REYCOM

    Portal Member
    August 19, 2008
    9
    2
    Home Country
    Switzerland Switzerland
    AW: MPTray not setting focus

    I found the problem with MediaPortal (and other applications that open in Fullscreen like Media Center etc.) not having Focus on Startup (showing Windows Taskbar instead)

    It is a new "feature" Microsoft Implemented some time ago: The Flashing Taskbar!


    You can disable it via Registry key:

    HKEY_CURRENT_USER\Control Panel\Desktop

    Create or edit 2 DWORD Values:

    "ForegroundFlashCount"
    "ForegroundLockTimeout"

    Set both to 0

    Reboot System...

    No more flashing taskbars stealing focus!!

    You can copy-paste this into a file call it "NO_TASKBAR_FLASH.REG" and just double click it.

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Control Panel\Desktop]
    "ForegroundFlashCount"=dword:00000000
    "ForegroundLockTimeout"=dword:00000000


    (You have to reboot the system to see the change)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    That is a good find. Only had a quick scan but reading
    ForegroundLockTimeout
    would make me think the correct way to code this would be to query ForegroundLockTimeout and wait that long before trying to set focus???
     

    REYCOM

    Portal Member
    August 19, 2008
    9
    2
    Home Country
    Switzerland Switzerland
    AW: Re: MPTray not setting focus

    That is a good find. Only had a quick scan but reading
    ForegroundLockTimeout
    would make me think the correct way to code this would be to query ForegroundLockTimeout and wait that long before trying to set focus???

    Default Value is 200000 milliseconds = 200 seconds...

    200 seconds would be a long time to wait ;)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    ahhh indeed.... seems a stupid value given the description on the MSDN site.... I guess it does not do exactly what it says...

    either way regedit will be open as soon as I get home...

    Oddly just got home to find that "ForegroundLockTimeout" was already set to 0 (I don't think I have ever set this)
    "ForegroundFlashCount" was still set to default of 3.

    Have set "ForegroundFlashCount" to 0 as well now and will see if it makes any difference
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    I'm running a FULL admin account, so I do not get the flashing taskbar, which tends to be linked to UAC anyway :D, even if I select always on top, that gets rid of the Windows Start button, but there is still no focus for remote, until mouse is used :(

    I actually consider this a bug, thats why its in mantis, hopefully some dev will find time and take a look soon.
     

    Users who are viewing this thread

    Top Bottom