View Full Version : Control Media Center when not Foreground
HiJon89
August 21st, 2009, 10:49 AM
Unless something has changed, there doesn't seem to be a way to send keyboard commands to Media Center when it is not the foreground app :sad:
So, the only thing to do is make Media Center the foreground app! Does anyone have any tips for writing a small little script that will quickly change Media Center to foreground, send the keyboard command, and then restore focus to where it was previously? Does anyone know how quickly this can be done? (hopefully the whole process can be done in <500ms so it's not too intrusive)
Also, why can't keyboard commands be sent to Media Center when it's not in the foreground? Don't the Microsoft brand Media Center remotes have this ability?
HiJon89
August 21st, 2009, 11:03 AM
Well it seems after some searching that even the Microsoft Media Center remotes can only control Media Center when it is in the foreground :confused:
In light of this I'm going to give up playing around with the targeting options because it seems there's just no way it's going to work. That still leaves the question of writing a script to change focus and change it back. Any help would be appreciated.
quixote
August 21st, 2009, 12:20 PM
Have you tried sending windows messages to MC? Maybe you can find a list online somewhere or try using command capture.
Ron
August 21st, 2009, 12:25 PM
This is going to be tricky no matter what, MCE is a DirectX application without actual real buttons,.. so things are going to be hard. Foreground keyboard is pretty much the best way to go here.
Btw you should be able to do what you want in a script. You can ask what the foreground app is, and set it.
HiJon89
August 21st, 2009, 12:29 PM
Have you tried sending windows messages to MC? Maybe you can find a list online somewhere or try using command capture.
I'll look into it, but I'm not optimistic. I think if there was any to control Media Center when it doesn't have focus Microsoft would have implemented on their media center remotes.
HiJon89
August 21st, 2009, 12:31 PM
This is going to be tricky no matter what, MCE is a DirectX application without actual real buttons,.. so things are going to be hard. Foreground keyboard is pretty much the best way to go here.
Btw you should be able to do what you want in a script. You can ask what the foreground app is, and set it.
Thanks, I figured as much. If scripted properly how long would you expect an entire process like this to take? (Change focus, send keyboard command, return focus)
Ron
August 21st, 2009, 12:35 PM
Hard to say this depends a bit on machine load. It's should be relatively quick less then a second I would imagine.
HiJon89
August 21st, 2009, 12:43 PM
Hard to say this depends a bit on machine load. It's should be relatively quick less then a second I would imagine.
Alright, I'll try scripting it up tonight. It shouldn't be an issue 98% of the time anyway.
And now that I think about it, I might just want to let Media Center keep the focus. If I'm using my computer on my monitor and leave a window open and then start using Media Center on the second display I don't want it to keep switching focus back and forth and back and forth every single time I press a button on the remote, the focus should stay on Media Center until I go back on the computer.
HiJon89
August 21st, 2009, 01:37 PM
Well after a lot of searching it appears the only way to get around this is to use a program like VMC Controller:
http://www.codeplex.com/VmcController
It allows you to control Media Center through telnet and will work even when it is not in the foreground. The downsides are it might not work at all with Windows 7 (especially not 64-bit), it is in very early beta, it has virtually no documentation, and it would require a lot more scripting in Girder to get it working.
So in conclusion, it's crazy enough that it just might work :D
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.