I was really annoyed by something when I got a new Dell PC with XP Media Center Edition. The media keys on the keyboard (like Skip, Back, Play, Stop, etc) didn’t work in iTunes unless it was the active window. In contrast, they did work with Windows Media Player, even if it was minimized (of course).
Since this was wholly unacceptable, I decided to spend a few hours devising a workaround. The result was two programs: iTunesKeys and iTunesCommandPasser (I know, great names). Both are written in C#, using the COM provider built-in to iTunes.
iTunesKeys basically creates a global keyboard hook looking for one of the media keys to be pressed. When that happens, it fires an event and executes the iTunesCommandPasser with a command line parameter telling it to skip, go back, or whatever.
The reason this is in two parts is that you cannot have two things going on via COM at the same time, under the same process. Since I am using COM for the hook, and to pass commands to iTunes, the two pieces had to be split in half. There may or may not be a more elegant way to deal with this, but I didn’t spend much time working on it.
To use the binaries, put the two EXEs and one DLL in the same directory, and launch iTunesKeys.exe. I’ve noticed that it seems to crash if you start iTunesKeys before iTunes the first time, since it probably isn’t registering correctly. I’m going to look at fixing that.
Zips below contain both programs.
Binaries
Source Code
Thanks to Dan Crevier at MSDN for discovering the COM abilities of iTunes.


January 20th, 2006 at 3:02 pm
thank you so much for this. it’s exactly what i was looking for.
January 23rd, 2006 at 6:11 am
Thanks for making this. It was very annoying to have to manually click the buttons in itunes to do this.
July 19th, 2006 at 11:45 am
Thanks for taking the time to make this available. So simple and so useful!
July 24th, 2006 at 9:45 pm
Thanks so much for creating this. This was the one reason why I refused to use ITunes beffore. Works great so far.
July 27th, 2006 at 11:43 am
Thank you so much for making this. it works great on my E1505!!!
August 20th, 2006 at 4:17 pm
Thank you for this gem.
i have not found anyone else doing this - very bizarre. As for Apple…well what are they up to?
software works great, perhaps a little hungry on resources 15,436K puts it in 7th place on my resouce hit list. however its definatly worth it!!
- Especially with my X-FI remote i can now control itunes more conveniently than ever!
Thanks again Andy,
Andy
August 22nd, 2006 at 8:55 am
Thank you… Just note that the ituneskeys needs to be run from the directory that you copied the files to. Can’t use path.
Works perfectly!!!
September 14th, 2006 at 5:30 pm
thanks it works great!
but i just updated iTunes now it wont work properly
September 16th, 2006 at 6:19 am
Great!
Thanks for solving that problem, and sharing it with the rest of us!
September 18th, 2006 at 10:12 pm
I use a program called HoeKey Takes up 168k its the second lowest on my memory list. Right now i use windows key->z to play. This program is fully customizable if you know the key codes. But i cannot find the media key codes to make it work.
October 11th, 2006 at 7:20 am
Thanks Andy
For some reason, I never had this problem before I got iTunes 7 and I’m hoping it will be solved in future updates. Until then, thanks for the good work!
October 21st, 2006 at 11:45 am
Thank you! Works great on E1405 (640m).
November 6th, 2006 at 1:50 am
@pino
I installed with itunes7 already installed, works great
November 8th, 2006 at 12:01 am
when i run ituneskeys.exe the red x error msg pops up “this prgm faield to initialize pls click to terminate prgm” i not sure if i puttin stuff in right directory…help pleease
November 10th, 2006 at 10:31 am
Thank you very much
This works with my Compaq Presario M2000
December 6th, 2006 at 5:39 pm
Amazing!!! 100% working on my Inspiron 6400!
December 11th, 2006 at 2:36 am
Damn, this is exactly what I was looking for for a really long time. Props to you!
December 11th, 2006 at 10:51 pm
hey, thanks for this handy tool!
Works a treat.
Although you think they would have this built into iTunes.
Colm.
December 18th, 2006 at 4:57 pm
Thanks a lot for this tool! Works like a charm.
I’m using it on Dell Inspiron 6000 with Win XP Professional.
Chiranth
December 21st, 2006 at 9:23 am
Hey, it works great. I’ve got a Dell Inspiron E1705. Thanks so much!
December 24th, 2006 at 5:37 pm
Wow…20mb of ram usage…I guess that’s why I paid for 2gb…lol :-p
Works perfect though, makes my g15 media keys work on itunes when it’s in the background. Thanks!
December 27th, 2006 at 5:08 pm
perfect
January 6th, 2007 at 10:00 pm
Wow. Thanks for this. This has been a thorn in my side for a year now. Works great!
Cheers.
January 18th, 2007 at 6:38 am
Sweet! Works an absolute treat. Why I needed to search google to fix this is beyond me. Come on Apple, pull your finger out!
February 4th, 2007 at 1:51 pm
You have no clue how much I’ve been waiting for this.
Thanks
February 9th, 2007 at 11:25 am
Great job!
February 15th, 2007 at 6:54 pm
Dude, you rock. The program works great in Vista Business.
February 16th, 2007 at 12:18 am
Dude you rock thank you so very much!!!
You are a f#@$n genius!!
February 21st, 2007 at 9:43 am
Works great for selecting tracks.
On my Inspiron 9300 though the play/pause button does not work.
March 3rd, 2007 at 4:59 pm
Thank you very much.. Exactly what I was looking for
March 11th, 2007 at 11:49 pm
I’ve put the 3 extracted files from the Binaries zip into the same folder, and I’m getting app error messages when I go to run the .exe files.
Do these not work with iTunes 7.1? or am I doing something wrong.
Please help! thanks
March 13th, 2007 at 5:27 pm
Luke, iTunes 7.1 should support media key use even when not the window is not active.
March 17th, 2007 at 10:36 pm
it works for one try and then it doesnt and sometimes the error message pops up i have 7.1 i dk if im oding it right.
March 23rd, 2007 at 10:46 am
Hey, it doesn’t seem to work my Acer Aspire. That’s a pity but nice shot anyway!
March 24th, 2007 at 11:31 pm
Thanks! This is awesome!
However, I’m on an Inspiron E1405 and the Play/Pause button doesn’t seem to work. When I hit the button, it pauses and starts right away without hitting anything else.
This is an excellent tool, thanks again.
May 5th, 2007 at 5:19 pm
It works great, thanks a lot.
May 28th, 2007 at 2:40 pm
Sweet! Thanks alot!
June 1st, 2007 at 11:22 pm
Wow, thanks! I was so pissed off when those keys suddenly stopped working, and going back to iTunes 6 suddenly meant my library was unreadable… grr…
You`re a lifesaver! Well, probably not, but it`s still made my day.
June 3rd, 2007 at 10:55 am
A fantastic little piece of kit, thanks for the time you put into it!
June 5th, 2007 at 6:51 pm
I just upgraded to iTunes 7.2 and experienced this annoying problem. This program fixed it perfectly, thanks a lot!
June 15th, 2007 at 8:35 pm
Thanks this app works perfect.
Would it make sense to be able to install this app as a service? Anyone know how to do that?
June 18th, 2007 at 12:05 am
Awesome - it rocks!
June 23rd, 2007 at 2:13 pm
When I try to run ituneskeys.exe an application error pops up with “The application failed to initialize properly (0xc0000135).” Can anyone help me out?
June 23rd, 2007 at 2:18 pm
Well done, I was about to write a similar proggy before I found your post…
June 24th, 2007 at 10:04 am
My ituneskeys has just stopped working, anyone else have any issues?
June 27th, 2007 at 1:52 pm
I love you.
June 30th, 2007 at 2:10 am
Not being able to control iTunes from my inspiron’s media buttons has bugged me for a long time. This app just worked (iTunes 7, XP Pro, Inspiron XPS). Many, many thanks. Let’s hear it for people solving problems!
July 4th, 2007 at 3:16 pm
Hey! Thanks for this. For the record: This works with iTunes 7.3.0.54
Saludos,
July 4th, 2007 at 7:19 pm
OK, so I’m not crazy. I thought the media keys worked even without the itunes window being active back in the v6 days. I just don’t understand why apple takes features away with each new release. Are they trying to add up little annoyances to get us to all buy Macs? lol
Anyone have a good way of starting itunes and ituneskeys together? Some sort of script… or something?
July 14th, 2007 at 5:30 pm
You are Godlike. I love you. lol, I’ve been looking for something like these for what seems like forever. OMG, I can’t believe that is that simple and yet complicated. LOL. Thank You so much!!!
July 20th, 2007 at 7:39 am
Thanks a million Andy! Works like a charm.
July 26th, 2007 at 6:58 pm
thank you so very much!!!
July 27th, 2007 at 8:59 pm
wow. the buttons didn’t always work until I met you. thanks
August 3rd, 2007 at 1:16 pm
Thanks a lot. Good work.
August 3rd, 2007 at 8:23 pm
Hey I was just curious if there’s anyway to get this to run at startup. I know there has to be a way to do it in windows even though the option isn’t in iTunesKeys. Its not just the fact that I have to manually start it but the task bar shows the icon and each time I have to hide it. Its not a bad icon I just like my task bar neat and clean. Thanks for the help and great work! Using it with iTunes 7.3.1.3 and Vista home premium for those who keep track.
August 4th, 2007 at 4:18 pm
awesome. this is perfect for me. thanks a bunch.
August 14th, 2007 at 9:55 am
Great program, except that it’s taking up 20,244k of memory on my system! Seems a bit much for a simple plugin, if you ask me. WinXP Pro, iTunes 7.3.2.6.
August 15th, 2007 at 1:27 am
Thank you SO much for this utility - having just upgraded to Vista I was distressed to find my G15 wouldn’t control my iTunes without it being the focus window. This simple utility restores the functionality I was used to previously
August 15th, 2007 at 9:57 pm
I’ve tried putting the two files and the dll in one directory however it fails to work, do you hvae a solution to this? would it be because i am using the most updated itunes?
August 15th, 2007 at 10:49 pm
So until recently the keys worked automatically with itunes even when unfocused, but since I upgraded itunes, it wasn’t working. This program fixed it! Awesome. Thanks.
August 27th, 2007 at 11:27 am
Thanks
August 30th, 2007 at 1:39 pm
Man, You realy did a great job, I was using the media buttons with itunes 6, now with itunes 7 don’t work anymore, but now with your program they works again!!
Thank you very much.
September 5th, 2007 at 8:02 pm
Hey! I have read all the comments and no one seems to have my problem… The tool works perfectly. Its (again!) vista comming in the way to complicate simple things.
After I run the tool, everytime I press one of the media keys Vista asks for permission to open/run a file. Even though i clicked the “dont ask again” check box (the text is something like that, you get the point) it keeps asking!
Any thougts?
September 5th, 2007 at 10:59 pm
So, I’d been using this program for a couple months, and everything was working perfectly on my XPS M1210 w/ Vista Ultimate. And then about two weeks ago it just stopped working. I get prompts to “Allow/Deny”, and the program keeps failing with error “iTunesKeys.exe - Common Language Runtime Debugging Services. Application has generated an exception that could not be handled.”
I LOVE this software, and will happily pay for the knowlegde of how to make it work for me again.
September 14th, 2007 at 9:21 am
Terrific! Works great with my G15 keyboard regardless of what application is running in the foreground. You rock!
September 20th, 2007 at 3:32 pm
Wow, that’s incredible. Thank you so much!
September 27th, 2007 at 1:56 pm
Does not work on Vist abusiness, see comment #64.
September 29th, 2007 at 5:27 pm
kick ass man! working great on my dell e1705. thanks alot!! it was extremely annoying
September 30th, 2007 at 3:28 pm
Excellent. Thank you.
October 2nd, 2007 at 6:00 pm
Could you make a version that doesn’t show the try icon?
October 3rd, 2007 at 12:46 am
Its very sad that Apple must act this way towards its PC user base just because they wish to make PC’s seem inferior.
October 12th, 2007 at 8:24 am
Thanks for this program ts small and quite memory intensive for such a small program but who cares it works. For people having problems try re-downloading the files. I cut and pasted the files into the itunes folder coz it seemed like the most logical place to put the three fles. Also follow what was written open itunes first then run ituneskeys.exe. That should do it. Also I am running vista so vista is not the cause for your problems.
Jon, to auto start make a shortcut of ituneskeys.exe and cut and paste it into the startup folder in the ‘All Programs’ menu. Also to hide the taskbar icon right click on the task bar go to properties an in there somewhere you can tell windows to always hide the icon.
October 12th, 2007 at 10:30 am
Thx a lot for this app! i’ve also installed vista and my g15 keyboard media buttons weren’t working anymore…
your app has reenabled it in vista BUSINESS, beautiful!
yours, shere
October 15th, 2007 at 6:59 am
thanks a bunch mate!!
anyone up for making a command prog-string to open itunes then the keysprog?
October 19th, 2007 at 6:43 pm
incredible just what I was looking for
October 26th, 2007 at 11:30 am
Bravisimo!!!
October 31st, 2007 at 3:48 pm
I downloaded them, put the in the same dir, but when I click iTunesKeys it gives me an error saying failed to initialize. I have tried to re download it, and I do open iTunes first. Any help would be great, thank you.
November 1st, 2007 at 11:26 pm
Wow, thank you, this has rescued me from a pit of frustration!
November 7th, 2007 at 3:54 pm
Dear Andy,
After downloading your programs, I thought that this wouldn’t work. But I was wrong.
I just got a G-15 keyboard, and it works beautifully. Thanks.
- Mike
November 7th, 2007 at 6:54 pm
Well played, sir. This works like a charm with my new zboard.
November 12th, 2007 at 12:36 am
HAHAHA, YOU LITTLE BEAUTY! worked a charm for my crappy acer aspire KU-0355 keyboard.
November 15th, 2007 at 10:49 pm
Does exactly what it needs to do. I’ll be putting this in my startup.
November 18th, 2007 at 10:11 pm
that was so easy! thank you for this amazingly simple and effective program. I’m using the new Dell Inspiron 531s just in case you were keeping track of that stuff.
November 19th, 2007 at 8:25 am
This is a nice program. Thank you for sharing your work. Maybe I’m being picky but it seems to be a little slow to respond on my computer (around 1 sec). Any ideas. Running it on a Dell Precision M90.
November 23rd, 2007 at 2:48 am
thanks dude! works perfectly on my Vaio laptop, Vista Home Premium + iTunes 7.5
December 3rd, 2007 at 2:10 pm
Awesome! What a simple fix… I have been dealing with this issue with my G15 Keyboard and iTunes for months. Thank you so much!
February 7th, 2008 at 11:25 am
Just wanted to add another to the list of satisfied customers. Kicka$$!!!! let’s get married
February 11th, 2008 at 12:51 am
Thank you so much! I’ve been looking for a fix since the media buttons stopped working after updating iTunes.
February 19th, 2008 at 5:35 pm
Thanks!
Great stuff!
February 19th, 2008 at 8:07 pm
Oh My Gosh you are a SAVIOR!!! I LOVE YOU! Thanks sooo much!
February 28th, 2008 at 1:12 pm
Love the idea of this but I get an error every time on my system. I make sure iTunes is running first, then start iTunesKeys.exe (have downloaded a few times and tried it in my documents folder and in program files). It starts up fine but when I push a media key I get the following error every time:
———-
iTunesKeys.exe - Common Language Runtime Debugging Services
Application has generated an exception that could not be handled.
Process id=0xa04 (2564), Thread id=0×11ac (4524).
———-
I am running Windows Vista Ultimate 32-bit on a Toshiba Satellite A130 laptop, iTunes version 7.6.1.9.
February 28th, 2008 at 1:17 pm
Great work, media keys have been bugging me for months!
Running a Dell XPSM1330 2.2Ghz with Vista Ultimate 32-bit, and the iTunesKeys works perfectly.
Thanks
March 2nd, 2008 at 3:30 pm
THANK YOU.
Had been using Multi-Plugin, but it hadn’t been updated in forever (I think the last release was for iTunes 7.0.2)… It’s nice to have a fix that isn’t version-dependent!
March 3rd, 2008 at 2:41 pm
Thanks
March 18th, 2008 at 3:32 am
Great program, works smoothly on my Dell Inspiron 1720 with Vista Prem. Thank you for this wonderful program.
March 20th, 2008 at 11:11 am
Ur a real saver, great saver, cant see y apple didnt think of it
March 29th, 2008 at 12:26 pm
You are amazing……a genius. Just wondering. What do you get out of it?
Thanks
April 1st, 2008 at 7:00 am
Wauw! So much thanx dude! seriously!
Many,many thanx!
April 4th, 2008 at 9:24 pm
Thanks so much! I’ve been trying to work this problem out for ages!
April 5th, 2008 at 7:07 pm
Thank you so much for this! I play World of Warcraft and Guild Wars (online video games), and when I’m playing alone I perfer to listen to music. It was annoying, at the least, to need to switch to iTunes to change the song (or pause it when needed). This is exactly what I needed.
April 10th, 2008 at 6:00 am
Thanks.
Got it working in about 10 secconds (unusual for me :P) and it’s really usefull. Something you wouldn’t be able to go without after trying it.
Thanks again, great work.
April 18th, 2008 at 2:53 pm
Seems to work for my rocketfish bluetooth mouse and keyboard too. Thanks.
April 29th, 2008 at 3:20 pm
This is amazing thank you!