[WINDOWS] HOW-TO Switching between WinMCE, XBMC, etc. fluidly with the Harmony remote
#1
*MODS* Please move this tot he How-To Section.

My goal was to be able to watch both Live and Recorded TV along with Netflix in Windows MCE then move over to XBMC fluidly with the remote only. This will be expanded to PowerDVD, Hulu, and possibly Boxee.

First start off with downloading AutoHotKey http://www.autohotkey.com/download/ This will allow us to script a function key to shut down WinMCE and start XBMC or vise versa. Here is my script.

Code:
;Run XBMC
;Pressing F12 starts this.
  F12::  
;If WinMCE is running it will be closed  
  IfWinExist, ahk_class eHome Render Window
  WinClose, ahk_class eHome Render Window  
;This waits for 2seconds because if the resolution hasn't  changed back quick enough sometimes XBMC crashes on startup      
  Sleep 2000        
;Starts XBMC
  Run [i]C:\Program Files (x86)\XBMC\XBMC.exe[/i]          
  return

;Run MCE
;Pressing F9 starts this.
  F9::          
;If XBMC is running it will be closed
  IfWinExist, ahk_class XBMC
  WinClose, ahk_class XBMC          
;This waits 2 seconds so the resolution changes back to normal
  Sleep 2000        
;Starts XBMC
  Run [i]C:\Windows\ehome\ehshell.exe[/i]          
  return

Obviously check and update the paths (italicized text above) but that should work for most. The beauty of this is it will start the desired program and if the other isn't running it won't freak. I started out just using Alt+F4 but that is flawed.

On to the Harmony remote. In my basic setup I have 3 devices.
  • My TV to control source, volume, and mute.
  • The MCE Keyboard so I can map all the XBMC keyboard shortcuts to each button.
  • The MCE so I can control WinMCE

Then I have then set everything up as "activities". I'll let you all worry about setting the key maps to your preference inside your activities.
  • Watch TV - This brings up WinMCE and goes to live TV. I do this by setting up the activity to hit F9 via the MCE Keyboard to close XBMC, Open WinMCE and then you can set where it goes inside WinMCE.
  • Watch XBMC - This its F12 and switches to XBMC then has all the keyboard keys mapped properly.

List of Keyboard shortcuts by program to make life easier.
XBMC
WinMCE
Boxee
Power DVD
Reply
#2
I enhanced the script to include Boxee, HuluDesktop, and PowerDVD10 so I can watch Blurays. I haven't tested this a ton so it may get updated but It checks to see if any other media apps are running and shuts them down in favor of the one you want to launch. It also makes sure to maximize the app since some times it won't be full screen by default (looking at you Hulu Desktop.) I'm not totally sure on the Class for Boxee so I'll confirm later. I'll spend the night fine tunning the key map on the Harmony side for each of these tasks.

Code:
;Run XBMC
F12::
IfWinExist, ahk_class eHome Render Window
WinClose, ahk_class eHome Render Window
IfWinExist, ahk_class Boxee
WinClose, ahk_class Boxee
IFWinExist, ahk_class CyberLink Universal Player Window Class
WinClose, ahk_class CyberLink Universal Player Window Class
IfWinExist, ahk_class HuluDesktop_Host
WinClose, ahk_class HuluDesktop_Host
Sleep 2000
Run C:\Program Files (x86)\XBMC\XBMC.exe
Sleep 2000
WinMaximize, ahk_class XBMC
return

;Run Boxee
F8::
IfWinExist, ahk_class eHome Render Window
WinClose, ahk_class eHome Render Window
IfWinExist, ahk_class XBMC
WinClose, ahk_class XBMC
IFWinExist, ahk_class CyberLink Universal Player Window Class
WinClose, ahk_class CyberLink Universal Player Window Class
IfWinExist, ahk_class HuluDesktop_Host
WinClose, ahk_class HuluDesktop_Host
Sleep 2000
Run C:\Program Files (x86)\Boxee\BOXEE.exe
Sleep 2000
WinMaximize, ahk_class BOXEE
return

;RunPower DVD
F7::
IfWinExist, ahk_class eHome Render Window
WinClose, ahk_class eHome Render Window
IfWinExist, ahk_class XBMC
WinClose, ahk_class XBMC
IfWinExist, ahk_class Boxee
WinClose, ahk_class Boxee
IfWinExist, ahk_class HuluDesktop_Host
WinClose, ahk_class HuluDesktop_Host
Sleep 2000
Run C:\Program Files (x86)\CyberLink\PowerDVD10\PowerDVD10.exe
Sleep 2000
WinMaximize, ahk_class CyberLink Universal Player Window Class
return

;Run MCE
F9::
IfWinExist, ahk_class XBMC
WinClose, ahk_class XBMC
IFWinExist, ahk_class CyberLink Universal Player Window Class
WinClose, ahk_class CyberLink Universal Player Window Class
IfWinExist, ahk_class Boxee
WinClose, ahk_class Boxee
IfWinExist, ahk_class HuluDesktop_Host
WinClose, ahk_class HuluDesktop_Host
Sleep 2000
Run C:\Windows\ehome\ehshell.exe
Sleep 2000
WinMaximize, ahk_class eHome Render Window
return

;Run HULU
F6::
IfWinExist, ahk_class eHome Render Window
WinClose, ahk_class eHome Render Window
IfWinExist, ahk_class XBMC
WinClose, ahk_class XBMC
IFWinExist, ahk_class CyberLink Universal Player Window Class
WinClose, ahk_class CyberLink Universal Player Window Class
IfWinExist, ahk_class Boxee
WinClose, ahk_class Boxee
Sleep 2000
Run C:\Users\Crump\AppData\Local\HuluDesktop\HuluDesktop.exe
Sleep 2000
WinMaximize, ahk_class HuluDesktop_Host
return
Reply
#3
Ok all the Classes are verified and it seems to work just fine. I did however add a new activity. It uses the Windows Media Center SE device as a mouse. Also I added to the script that when going to that activity it brings up the on screen keyboard. So this now is a Mouse Keyboard activity.

Code:
F5:: Run <Your Path>\osk.exe
Reply
#4
Is there a MOD that can please move this?
Reply
#5
Will no one move this for me?
Reply
#6
Thanks for the posts, this is exactly what I have been looking for. It's like you read my mind Big Grin

Now just need to find the time to get it going on my system. Although first I need to work out why my volume up has stopped working on the dharma beta build... Huh
Reply
#7
rainierez Wrote:Then I have then set everything up as "activities". I'll let you all worry about setting the key maps to your preference inside your activities.
  • Watch TV - This brings up WinMCE and goes to live TV. I do this by setting up the activity to hit F9 via the MCE Keyboard to close XBMC, Open WinMCE and then you can set where it goes inside WinMCE.
  • Watch XBMC - This its F12 and switches to XBMC then has all the keyboard keys mapped properly.

Thanks for posting this, it works perfectly!

I have a harmony too and have set it up to switch between XBMC and MCE thanks to the script (using F9 and F12 keypresses) but would you be able to let me know how you set yours up to auto switch to Live TV once MCE was opened?
Reply

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] HOW-TO Switching between WinMCE, XBMC, etc. fluidly with the Harmony remote0