Restore MP from system tray.exe (1 Viewer)


Super Moderator
  • Team MediaPortal
  • June 10, 2008
    New Zealand
    Home Country
    New Zealand New Zealand

    It's really annoying that I can't restore mediaportal from the system tray with MP_tray, so I made Restore_MP.exe which will find the MP system tray icon, and then double click on it. I have this set to run whenever I click the MCE button on my remote. If Restore_MP.exe can't find the tray icon then nothing happens, so it doesn't matter if you click MCE button when MP is already maximised, or when MP is not in the system tray.

    mp_tray.bmp - save this file as c:\mp_tray.bmp
    Restore_MP.exe - save this anywhere, run it to Restore MP. I've set it to run when I press the MCE button on my remote, as unfortunately MP_Tray will not run MP if it is already minimised into the system tray.

    Here is the script in autohotkey
    CoordMode, pixel, screen
    CoordMode, mouse, screen
    ImageSearch, FoundX, FoundY, 1500,980, 1920, 1200, C:\mp_tray.bmp
    if ErrorLevel = 0
    FoundX += 5
    FoundY +=5
    MouseMove, FoundX, FoundY
    Sleep 500
    Click, 2
    1500,980 is the X,Y co-ordinates to start searching for the icon and 1920,1200 is X,Y to stop searching.
    If your display is 720P then you would change it to something like 1000, 600, 1280 , 720
    If it doesn't work you could try using Ctrl+Print Screen, then crop out the system tray icon, and save it as c:\mp_tray.bmp
    I've added 5pixels to the co-ordinate because image search returned the top left corner co-ordinate, and you want to click close to the centre of the system tray icon
    Hope someone else finds this useful


    • Restore
      356.2 KB
    Last edited:

    Users who are viewing this thread

    Top Bottom