Jump to content
LaunchBox Community Forums

Integration of Big Box into Windows Media Center 7


silver

Recommended Posts

I've managed to get Big Box integrated into Windows Media Center 7 (WMC) so that you can launch it from the WMC main menu with the remote control.

If Big Box closes then WMC becomes active again. and if WMC ends up in the foreground (for example, when you press the Windows button on the remote) then Big Box will be automatically closed. 

If anyone is interested in instructions on how to do this please let me know and I'll post them up somewhere.

bigbox_wmc.png

Edited by silver
Link to comment
Share on other sites

We're a small (and getting smaller) dedicated bunch :)

To be honest, what is does works pretty well. Every time I flirt with something different (Kodi, MediaPortal and Emby) some feature we rely on either don't work very well, have a horrific UI or are just plain broken - which means it fails the WAF test.

She always complains that the alternatives look like they were "designed by 16 year olds, for 16 year olds" :D

Link to comment
Share on other sites

  • 6 months later...

No worries, well done for finding it ?

You might be interested in the AutoHotKey code below. It should be called from WMC and it'll handle ensuring that you return to WMC after you've finished with BigBox. In addition, it'll automatically close BigBox when it spots that WMC is now back in the foreground. 

Save it as (say) "launch_bigbox.ahk", compile it to "launch_bigbox.exe" and put that somewhere which can be launched without invoking UAC. Make sure that your "run=" line within "Bigbox.xml" points to this executable.

Finally, bear in mind that I have Launchbox installed in "D:\Games\Launchbox" and you probably won't.

#Persistent

; Check if Big Box is running, if not then launch it

IfWinNotExist, LaunchBox Big Box
{
    Run D:\Games\LaunchBox\BigBox.exe, , ,bbPID 
    Sleep 2000
    ; Kill WMC to free up resources
    Process,Close,ehshell.exe
    Sleep 13000

}
else ; Else activate it and bring it to the foreground
{
    WinActivate
    WinRestore
    WinMaximize
}

; Set a timer to check every 2 seconds on the state of play

SetTimer, CheckProgram, 2000 
return 

CheckProgram: 
    ; If Big Box isn't running any more, start WMC
    IfWinNotExist, LaunchBox Big Box
    {
        Restart_WMC()
        ExitApp
    }

    ; If WMC is now active, close Big Box
    WinGetActiveTitle, NowActive
    If (NowActive = "Windows Media Center")
    {
        Process,Close,%bbPID% 
        Restart_WMC()
        ExitApp 
    } 
    return 

    
Restart_WMC()
{
    ; If WMC is already running, maximize it
    IfWinExist, ahk_class eHome Render Window
    {
        WinActivate
        WinMaximize
    }
    else ; Restart it
    {
        Run, C:\Windows\ehome\ehshell.exe /nostartupanimation,,Max
        Sleep 2000
        WinActivate
        WinMaximize        
    }
    ExitApp
}

Shout if you get stuck.

Edited by silver
Link to comment
Share on other sites

20 hours ago, silver said:

No worries, well done for finding it ?

You might be interested in the AutoHotKey code below. It should be called from WMC and it'll handle ensuring that you return to WMC after you've finished with BigBox. In addition, it'll automatically close BigBox when it spots that WMC is now back in the foreground. 

Save it as (say) "launch_bigbox.ahk", compile it to "launch_bigbox.exe" and put that somewhere which can be launched without invoking UAC. Make sure that your "run=" line within "Bigbox.xml" points to this executable.

Finally, bear in mind that I have Launchbox installed in "D:\Games\Launchbox" and you probably won't.


#Persistent

; Check if Big Box is running, if not then launch it

IfWinNotExist, LaunchBox Big Box
{
    Run D:\Games\LaunchBox\BigBox.exe, , ,bbPID 
    Sleep 2000
    ; Kill WMC to free up resources
    Process,Close,ehshell.exe
    Sleep 13000

}
else ; Else activate it and bring it to the foreground
{
    WinActivate
    WinRestore
    WinMaximize
}

; Set a timer to check every 2 seconds on the state of play

SetTimer, CheckProgram, 2000 
return 

CheckProgram: 
    ; If Big Box isn't running any more, start WMC
    IfWinNotExist, LaunchBox Big Box
    {
        Restart_WMC()
        ExitApp
    }

    ; If WMC is now active, close Big Box
    WinGetActiveTitle, NowActive
    If (NowActive = "Windows Media Center")
    {
        Process,Close,%bbPID% 
        Restart_WMC()
        ExitApp 
    } 
    return 

    
Restart_WMC()
{
    ; If WMC is already running, maximize it
    IfWinExist, ahk_class eHome Render Window
    {
        WinActivate
        WinMaximize
    }
    else ; Restart it
    {
        Run, C:\Windows\ehome\ehshell.exe /nostartupanimation,,Max
        Sleep 2000
        WinActivate
        WinMaximize        
    }
    ExitApp
}

Shout if you get stuck.

Awesome, Thank You!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...