Changed to using process id (PID) instead of window name to identify the XBMC window. More accurate.