Welcome to MSDN Blogs Sign in | Join | Help

Position Changer Add-In updated for Media Center in Windows Vista

Back in early 2005, I wrote an article for MSDN on implementing add-ins for Windows XP Media Center Edition 2005.  As part of that article, I implemented an add-in that made it easy to jump around in a recorded TV show, video, or music file using the remote control, simply by entering a time code using the remote control's number buttons.  In October of 2005, I updated the add-in for Update Rollup 2.  Now that Windows Vista is out, I've updated it again for Windows Vista, and the new version is now available for download.

If you have User Account Control (UAC) enabled, follow the following steps to install the add-in (if you don't, just run the MSI):
1) Open a command prompt with "Run as administrator"
2) Run "msiexec /i pathtoaddin.msi", where pathtoaddin.msi is, you guessed it, the path to the add-in MSI.

Note that I removed a bit of functionality for this release, specifically the bookmarking functionality, as it interferes with the new mini-guide available in Vista.

As described in the article, using the add-in is pretty straightforward.  While viewing or listening to media, press the right arrow on the remote or keyboard.  Then enter the time you want to jump to (123 for 1 minute 23 seconds, 1053 for 10 minutes 53 seconds, etc.) and press enter.  Pressing the left arrow instead of the right arrow makes the jumps relative instead of absolute.

I hope this is useful to you.

Steve

Published Wednesday, January 03, 2007 11:43 PM by toub
Filed under: ,

Attachment(s): PositionChangerAddIn_Vista.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Thursday, January 04, 2007 7:56 AM by Olcay Buyan

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks for the update.

-Olcay

Thursday, January 04, 2007 3:16 PM by andy vt

# re: Position Changer Add-In updated for Media Center in Windows Vista

In the mce 2005 version, you were able to get the file name from the graph that mce publishes.  Were you able to make that work in vista?

Thursday, January 04, 2007 3:25 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

That's another reason I removed the bookmarking functionality.  In 2005, I used the hack of grabbing the published filter graph and extracting from it the path to the currently playing DVR-MS file as a way to create a key for storing bookmark information for a particular recording.  In Vista, for security reasons MCE no longer publishes the playback filter graph to the running object table, so this was no longer possible.

Thursday, January 04, 2007 3:57 PM by jonnycat

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks for the update!  Will the source for the updated version be made available? Or did I miss it somewhere?

Thursday, January 04, 2007 4:02 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Definitely.  Just haven't had the time to package it all up yet... hopefully will soon.

Friday, January 05, 2007 5:20 PM by Brad

# re: Position Changer Add-In updated for Media Center in Windows Vista

Awesome!  Thanks a lot Stephen.  This is a must have for Media Center...

Friday, January 05, 2007 5:37 PM by vern

# re: Position Changer Add-In updated for Media Center in Windows Vista

Does this version work on MCE 2005 also or do I need to keep that old MSI laying around?

Saturday, January 06, 2007 8:44 AM by Dave

# re: Position Changer Add-In updated for Media Center in Windows Vista

Will this program work on extenders such as the XBOX360?

Saturday, January 06, 2007 12:55 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Brad, thanks, glad you like it!

Vern, this version is Vista specific, simply because I updated it to rely on the new add-in hosting APIs.  I didn't have to do that, since Media Center in Vista supports add-ins written with the deprecated APIs, but when I release the code I want people to be able to compare the two versions to see the changes I made.

Dave, this should work fine on the 360, but make sure that when you install it, you select to install it for all users rather than for just you.

Saturday, January 06, 2007 6:38 PM by andy vt

# re: Position Changer Add-In updated for Media Center in Windows Vista

In RC2 (I haven't looked in RTM), the graph was still published, but I wasn't able to cast the filters into anything useful.  Someone over at the MCE Sandbox was able to extract useful information from them though.

Saturday, January 06, 2007 6:46 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

I have it on good authority that this was removed for RTM, but if you can show otherwise, I'd be interested in seeing it.

Saturday, January 06, 2007 8:06 PM by andy vt

# re: Position Changer Add-In updated for Media Center in Windows Vista

I'll take your word for it, I figured out another way to accomplish the same thing so I haven't needed to try it in RTM.  Only downside is that it requires admin rights, but that's easy enough to push into another process and use a mechanism like named pipes or com+ to communicate the info back.

Saturday, January 06, 2007 8:11 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Cool. Out of curiosity, what is the other mechanism you discovered?

Saturday, January 06, 2007 8:58 PM by andy vt

# re: Position Changer Add-In updated for Media Center in Windows Vista

"Discovered" is generous :)

I made the assumption that each instance of ehshell can only playback one file at a time, and in order to play a file it would have to have a handle on the file.  So I used NtQuerySystemInformation to get a list of all the files ehshell has open, in my case I'm only interested in dvr-ms files so it's pretty easy to filter.

It's a lot less elegant than the method you used, but it's also much less likely to go away in the future.

Sunday, January 07, 2007 5:16 AM by albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Stephen,

do you know another way to retrieve the filter graph from vista mce ?

The managed object model does not provide an access to the graph, and now that MCE no longer publishes the graph into the ROT, I guess that we are stuck...

Thanks

Albain

Sunday, January 07, 2007 5:00 PM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

There may be another way, but I am not sure about the stability : FFDShow is able to publish the graph into the ROT (there is a registry key in ffdshow settings to enable this).

So if you are using ffdshow with this setting or if one could create a generic directshow filter that does nothing else than publishing the graph into the running object table (I don't know if it is possible)...

Sunday, January 07, 2007 9:04 PM by andy vt

# re: Position Changer Add-In updated for Media Center in Windows Vista

Even when WMC was publishing the graph (in RC2), it was doing something to the filters so they couldn't be cast into their proper interfaces.

Tuesday, January 09, 2007 10:28 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

I finally found what the problem was !

My SDK was still recent but not enough. I recovered the last version of graphedit, including

the last version of proppage.dll and this is it : you have to register it with regsvr32, and all the missing interfaces are back : IGraphbuilder.

Of course, it does not solve the issue with the non-publishing of the graph into the ROT by WMC...

Wednesday, January 10, 2007 11:37 AM by Rick Vestal

# re: Position Changer Add-In updated for Media Center in Windows Vista

Has anybody had this work on their 360?  I installed multi-user, it works on the vista box, but after hitting the right/left arrow on the remote, the 360 still wants to change channels when I type in numbers.

Thanks,

-- Rick

Wednesday, January 10, 2007 11:43 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

I'll test it out again tonight on my 360 and let you know what I find.

Wednesday, January 10, 2007 11:11 PM by Craig L. Davis

# re: Position Changer Add-In updated for Media Center in Windows Vista

Any chance that there is a way to simply use FF and RW when playing music?  Seems like you've tapped into something way more powerful, but just a simple FF and RW on MP3's in MCE would be great.

Thanks!

Wednesday, January 10, 2007 11:19 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Craig-

I'm not sure I understand the question... are you asking if it's possible to just fast-forward and rewind when playing music in MCE?  I've never had trouble doing so, although all of my music is in WMA format and it sounds like yours is in MP3; maybe that makes a difference?  I can try it when I get home tonight (stuck at work due to the traffic resulting from the snow here in the Seattle area).

Thursday, January 11, 2007 4:31 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

As with Rick, I'm also having trouble with this on my 360 using my Media Center remote.  I looked into it briefly, and the issue appears to be that the 360 is receiving different key values than is the PC, so while the add-in's hook is in fact intercepting the values, the code in the add-in to decipher the key strokes and do something useful with them is seeing, in-effect, gibberish, and thus isn't seeing the commands to skip around.  The questions now are: why is it getting different key values from the 360, and how can I fix it?  I'll try to look into that soon.  In the meantime, I'll post a new version tomorrow that includes a few minor bug fixes.

Thursday, January 11, 2007 5:37 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Stephen,

It has been a while I am working on this issue : when I register a graph into the Running Object Table and then unregister it correctly (I can see the graph appearing and then disappearing in graphedit / Connect to remote graph), the graph won't unload after ending the media.

When WMC registered its graph (in WMCE2005), it was correctly unloaded, so what can be the difference here ?

I am using WMC in Vista, and the graph is registered and unregistered into the ROT through a running filter (ffdshow).

I also tried to unregister the graph before stopping the video, but still the same.

Thank you for your help

Albain

Friday, January 12, 2007 7:18 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

OK I got it : the graph has to be unregistered before the graph would unload otherwise it won't work. Besides all the access must be cleaned (filters, graph...)

Saturday, January 13, 2007 10:59 PM by Haggis

# re: Position Changer Add-In updated for Media Center in Windows Vista

I have installed this on a Vist 64 RTM computer and it doesn't seem to work. Is this a x86 only Visat MCE plugin?

Saturday, January 13, 2007 11:01 PM by Haggis

# re: Position Changer Add-In updated for Media Center in Windows Vista

In addition to my comment above, when I try to uninstall it, the ininstaller pops up an empty dialog box (ie cannot read it) and a okay button. What ever I select, the uninstallation fails

Thursday, February 08, 2007 3:36 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Stephen,

I have tried to implement the same keyboard hook as you did, and it working, but only for simple keys : arrows and numbers only.

Play/pause, fast forward key... and all the keys with "control" and/or "shift" in it are not caught. Do you know why ?

You can visit my website to see the plugin I have made, everything is working except the remote.

Thank you for your help

Damien

Thursday, February 08, 2007 3:36 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

Forgot the url of my website : http://damienbt.free.fr

Thursday, February 08, 2007 11:06 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Play/pause/etc. are translated into Windows messages other than WM_KEYDOWN.  See my discussion of WM_APPCOMMAND in my article at http://msdn.microsoft.com/library/en-us/dnxpmce/html/positionchangeraddin.asp, as well as the mappings listed in the Using the Remote Control Device article at http://msdn2.microsoft.com/en-us/library/ms867196.aspx.

As for "shift", I explicitly ignore that in the hook... see the line that includes "&& GetKeyState(VK_SHIFT) >= 0".  You can of course change that as necessary.

Friday, February 09, 2007 3:23 AM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks for your answer, I will have a look at those

Friday, February 09, 2007 1:16 PM by Albain

# re: Position Changer Add-In updated for Media Center in Windows Vista

I don't think it is possible to use your first method, by overriding Wndproc in a Form (or Nativeform) : now addins are loaded into separate process (ehexhost.exe), so assigning the same handle as the ehshell main window does not work.

I tried to register the remote using the RegisterRawInputDevices in a separate app, and I do receive the remote control commands...as long as I have the focus. If the focus is on media center I don't receive commands anymore.

If you have an idea, I would really appreciate your feedback :-)

Thanks

Wednesday, February 14, 2007 8:30 AM by humperdink

# re: Position Changer Add-In updated for Media Center in Windows Vista

I've been playing around some with the source trying to get this to work with my 360 on Vista.  Has anybody figured out how to get the number keys recognized?  

Using the low level keyboard hook, the left/right/up/down commands come in fine, but numbers come back as Keys.Packet and the actual code doesn't appear to be encoded in the wparam or lparam.

Thanks

Wednesday, February 21, 2007 11:33 AM by aaron

# re: Position Changer Add-In updated for Media Center in Windows Vista

any chance this could be enhanced to include a set skip?  something like hitting the left key for an incremental skip but then map it to the up or down arrow and set a value (say 15 mins) and be able to skip in 15 min chunks?  My cable dvr has a 15 min skip and its pretty useful for skipping through a file w/o having to know the exact position you are looking for.

not that its a huge issue now but its alot of button presses to mimick this functionality (left arrow and then 1 5 0 0) and you have to do that each time to skip 15 mins.  (this is mainly useful for movies since there arent chapter's on recorded movies or even those ripped to wmv)

Wednesday, February 21, 2007 3:37 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

The code could certainly be updated to include functionality like that, sure.  It would just be a matter of adding another if/else condition to the hook_KeyDown method.  The code would get a TimeSpan for whatever length of time you wanted (either hardcoded or pulled from some configuration settings) and would do something like this:

 TimeSpan time = TimeSpan.FromMinutes(15);

 TransitionToTime(time);

 ClearInputAndResetTimer();

 DisplayPosition();

Wednesday, March 14, 2007 2:41 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Humperdink, I just updated the code so that it does in fact work with the 360 (just tested it).  I'll have that up on my blog and on MSDN shortly (hopefully).

Thursday, March 15, 2007 2:57 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

I've updated the source so it should now work with an Xbox 360 extender (at least it does with mine).  Haven't created a new installer yet.  Hope that helps!

Saturday, March 17, 2007 6:15 PM by Zeev

# Where is the msi installer??

Seems like the .msi installer has disappeared, only the source code is in the zip. Where can I get the msi for Visa??

Saturday, March 17, 2007 6:18 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Zeev, see my previous comment, specifically the second sentence:

"I've updated the source so it should now work with an Xbox 360 extender (at least it does with mine).  Haven't created a new installer yet."

So there isn't an MSI right now.  For now you can manually use gacutil.exe and RegisterMceApp.exe.

Saturday, March 17, 2007 7:43 PM by Ryan Hurst

# re: Position Changer Add-In updated for Media Center in Windows Vista

Sunday, March 18, 2007 6:43 AM by Zeev

# msi installer cont. for toub

Thanks for your reply.

Given I'm a U*nix person, can you please elaborate on the use of gacutil.exe and RegisterMceApp.exe to enable me to install the Addin on my Vista MC?

Thanks.

Sunday, March 18, 2007 2:13 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Zeev-

If you have the .NET Framework SDK installed, you'll have gacutil.exe (you can also just copy it from a machine that has the .NET 2.0 SDK).  If you have it, you just do:

   gacutil.exe -i DllPath

to install the assembly into the GAC (see the docs for more info if you like).  Once it's in the GAC, you register it with Media Center, with the RegisterMceApp tool in %windir%\ehome:

   RegisterMceApp /allusers XmlRegFile

where the XmlRegFile is the .xml file I included with source and binaries.

If you don't have the .NET Framework SDK, Ryan Hurst has posted directions for how to install it without gacutil:

http://unmitigatedrisk.com/archive/2007/03/17/38.aspx

I'll try to create an MSI shortly, but in the meantime, that should work.

Thursday, March 29, 2007 3:02 PM by John Kennedy

# re: Position Changer Add-In updated for Media Center in Windows Vista

Any eta on a possible msi for this. It would be incredibly useful for me. I have never used .net SDK, so I tried Ryan Hurst's method. Well after running through the Vista permissions maze for over an hour, I finally found it easier to teach myslf how to use the gacutil. I followed the steps and was told they were successful on both counts. I am now in MCE, but when I push my right arrow I get nothing.

Thursday, March 29, 2007 3:09 PM by John Kennedy

# re: Position Changer Add-In updated for Media Center in Windows Vista

Okay, so I wasn't pushing enter after right arrow/time ahead. DUH! Thank you very much for this great add-in!

Wednesday, July 11, 2007 3:53 PM by Michael

# re: Position Changer Add-In updated for Media Center in Windows Vista

Great job, and I wonder why this is not a part of a standard MCE. How difficult would it be to add some visuals: when you punch the keys, you don't see anything on the screen, only the result when you hit Enter. It would be nice to show some symbols and digits as you punch the keys on the remote control.

Thursday, July 12, 2007 1:01 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks, glad you like it!  Unfortunately, adding visuals given what's currently available would be pretty tough; not necessarily impossible, but I guarantee there would be quite a bit of hackery involved.

Tuesday, September 25, 2007 7:22 AM by sjgore

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi, This is exactly what I've been looking for, but I can't find a MSI file in the zip file in the link at the top of the page. Just lots of source files by the look of it. How do I install it? Steve.

Sunday, September 30, 2007 12:39 PM by Telstar

# re: Position Changer Add-In updated for Media Center in Windows Vista

.msi installer is missing in the zip

Monday, February 11, 2008 11:22 PM by Faustt

# re: Position Changer Add-In updated for Media Center in Windows Vista

The MSI file seems to be missing from the zip package for me as well. All I see is source code. What program do I need to use to compile this?

Tuesday, July 29, 2008 5:57 PM by Matthew

# re: Position Changer Add-In updated for Media Center in Windows Vista

Toub, still no MSI file in the zipped package. Any chance you can fix that? I'm dying to be able to skip ahead.

Thank you!

Tuesday, August 05, 2008 4:16 PM by Fredoc

# re: Position Changer Add-In updated for Media Center in Windows Vista

Same demande !

I tried to install it with gacutil, I followed all the instructions, evrything was OK. But it still doesn't work.

I really need the MSi file. Pleeeease !

Thank you

(sory for the mistakes, I'm french !)

Wednesday, September 17, 2008 8:53 AM by gjrober

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi there,

This worked for me on my Vista pc. Then I've upgraded to Vista SP1 and also installed the TV Pack. And now I can't get this to work.

How can I unregister the xml and the dll to stert over again please?

Alternatively an MSI would be great please.

Wednesday, October 29, 2008 1:39 PM by Jeff

# re: Position Changer Add-In updated for Media Center in Windows Vista

Yea, I could not get it to work with the TV pack either. It works perfect without the TV pack. Shame really, the TV pack finally fixed the errors with channel changing and different resolutions. I would gladly pay for this utility.

Monday, November 03, 2008 10:42 PM by Stephen

# re: Position Changer Add-In updated for Media Center in Windows Vista

I can confirm - this doesnt work with the TV pack installed. Is there a workaround for this?

Saturday, December 27, 2008 3:35 AM by R P

# re: Position Changer Add-In updated for Media Center in Windows Vista

I too failed to get this working after installing TV Pack. I unregistered using the /u option but still can't get it to work again. Any help here is greatly appreciated.

Sunday, January 04, 2009 7:24 PM by Rick

# re: Position Changer Add-In updated for Media Center in Windows Vista

I am having problems getting this plug-in to work with vista home premium 64-bit.  I have installed it using the following instructions.

Copy the contents of the debug folder to \Program Files\MCE\Position Changer Add-In

Open a command window with administrative privliges

cd \windows\ehome

fsutil hardlink create PositionChangerAddIn.dll "\Program Files\MCE\Position Changer Add-In\PositionChangerAddIn.dll"

cd "\Program Files\MCE\Position Changer Add-In"

"\windows\ehome\RegisterMCEApp.exe" /allusers "PositionChangerAddInReg.xml"

Restart all of your Media Center Sessions...

I have installed it using the program files folder and the program files (x86) folder.  I don't have the TV Pack installed.  thanks for any help.  

Thursday, March 05, 2009 2:37 PM by Alex

# re: Position Changer Add-In updated for Media Center in Windows Vista

The download of the PositionChangerAddIn no longer works, I get a 404 error on the url http://toub.members.winisp.net/Code/PositionChangerAddIn_Vista.zip.

I'm interested in the nice plug-in. Will the plug-in be back later?

Sunday, March 08, 2009 1:39 AM by Tom Prendergast

# re: Position Changer Add-In updated for Media Center in Windows Vista

PLEASE PLEASE PLEASE make this available for download again. I just upgraded my HTPC to Vista and the one thing I am missing is this! I had it for XP and I thought it was the greatest thing ever! Please put the file back up for download somewhere or if you dont want to, I will host it for you if you would like, just email me - tprendergast311@yahoo.com. Thanks!

Sunday, March 08, 2009 6:08 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

I'm glad you enjoyed it.  It's attached to this post:

http://blogs.msdn.com/toub/attachment/1409370.ashx

Monday, March 09, 2009 10:08 PM by Tom Prendergast

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks so much for the quick response but there doesn't seem to be an .msi file in this zip as mentioned in your instructions. Does this need to be compiled or something? Not to sound like a complete idiot, but I have no idea how to do that if that is the case. Let me know the easiest way for me to install. Thanks again!

Tuesday, March 10, 2009 8:58 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Wednesday, March 11, 2009 11:28 PM by Tom Prendergast

# re: Position Changer Add-In updated for Media Center in Windows Vista

Okay that was really easy, worked like a charm. Thanks so much!

Thursday, March 26, 2009 10:52 PM by Marvin

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Stephen;

Many thanks for the great add-in's!

I can't seem to find the version for MCE 2005.

I'd like to have the original 'full featured' one for 2005 - any chance you can post a link?

Thanks!

Friday, March 27, 2009 1:20 AM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Wednesday, April 29, 2009 8:09 PM by Matt

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Stephen,

Any way you can make this great add-in to work with TVPack? I am missing this feature so much. Thanks

Thursday, April 30, 2009 12:20 PM by toub

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Matt-

I haven't tried out the TVPack, and most likely I won't have the time to do such an update.  If I do, however, I'll certainly post about it.  Thanks for the interest.

Friday, June 19, 2009 11:06 AM by Matt

# re: Position Changer Add-In updated for Media Center in Windows Vista

Thanks Steve. Just so you know, even though this add-in doesn't work with Vista with TVPack, it apparently works with Windows 7. Great product. Thanks again.

Tuesday, August 11, 2009 7:01 AM by Spen

# re: Position Changer Add-In updated for Media Center in Windows Vista

Hi Matt, have you actually tried in windows 7? I can't get it to work.

I can't believe microsoft didn't impliment something like this as standard for Media center.

Thursday, August 27, 2009 3:04 AM by Jonny

# re: Position Changer Add-In updated for Media Center in Windows Vista

Just for internest sake working on Windows 7 RTM - no problem what so ever

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker