Tuesday, July 10, 2007

Media Player Tray Control for Vista

As someone who programs for a living and works from home it goes without saying that one of my primary applications is none other than Windows Media Player. When listening to music I rarely need to actually bring up the application window. Coupled with the fact that only one instance of the application is ever used it makes a perfect candidate for an alternative to the Windows Taskbar.

The most popular way to do this is to use Media Player Mini Mode, which adds a new toolbar to the taskbar. This provides some advantages over minimizing to the taskbar:
  • The Media Player Toolbar is in a fixed location. You always know where it is if you ever need to pause or skip to the next track. If you have a lot of windows open you don't have to hunt for it.
  • Every time a track changes a popup window displays the track info like Song Title, Album, and Artist.
  • The player controls are always displayed, you don't have to switch to the application to control it.
However I personally don't like the mini mode, here's why:
  • It takes up too much screen real estate. Under most people's Windows setup it takes up the same amount of space on the taskbar as traditional taskbar application. However I run my taskbar at 2U, which means that twice the real estate is used, as the media player toolbar is separated from the taskbar applications.
  • I actually find the song information popup window annoying. Especially because it activates when your mouse wanders over any part of the toolbar. And the popup lingers for a full seven seconds, which seems like an eternity when you want to get to whatever is behind the window. What makes it worse is that it is located directly underneath where I have the Solution Explorer/Property Window Tab Group docked in Visual Studio. My mouse is always wandering that direction, and if I happen to wander a few pixels down too far I get this for seven seconds.
What I prefer to use instead is the Media Player Tray Control. It takes up a mere 17x17 area of my tray and allows me to do my most common media tasks with ease as well. Clicking the tray icon itself pauses/unpauses. A context menu lets you skip or go back a track and gives you rudimentry volume control.

Not to say that the tray control doesn't have its share of flaws as well:
  • It seems to have a hard time keeping track of the Media Player application, it's supposed to hide it but various things will cuase media player to come back which confuses the tray app.
  • If Explorer crashes for any reason you can't get the tray icon back without first killing the mpxptray.exe process.
  • Having the volume controls as menu items? Come on...
  • Sometimes that Information Popup window is quite handy when you really want it With the tray control you have to right click the tray app, unhide the media player, find the app in the taskbar, then activate it.
However as I said above I still prefer it over the Mini Mode. So when I tried to install the Windows Media Player Bonus Pack for XP (it comes bundled with this, no standalone install). Windows is kind enough to tell me that it won't allow it to install because of compatibility issues.

I clicked the "Check for solutions online" button, but it was unable to find any solutions (big surprise).

However I was pretty confident that there was only one or two applications that were actually incompatible with Vista. Since I noticed that the executable I downloaded was a self extracting archive, I figured I'd poke around the files it extracted. It even gave me the path where it dumped everything.

Low and behold I found mpxptray.exe in the temp directory. I copied it to a new folder in the Program Files and ran it. Apparently it has no file dependencies because it ran just fine. Right click the tray control, open options, check "Run Tray Control at Startup" and your install is done.


Anonymous said...

Cool solution m8 :)

Anonymous said...

Thank you very much :-D Works like a charm ^_^

Toby Patke said...
This comment has been removed by the author.
Anonymous said...

Yeah - I found the popup thing REALLY annoying too. Developers should learn that, actually, their application is not the most important thing on the computer.

I found this which fixed the popup problem.


You [fix] this in v11 by creating REG_DWORD value named "DeskbandFlyoutTimeout" under
HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\P references . If you set it to 0x0, it'll never show up. If you set it to 0xFFFFFFFF it'll always show up. Anything in between it'll show up for that many milliseconds. The normal setting is I believe 3000ms. If that value is not present, the default is used."

Anonymous said...

killer solution!

Anonymous said...

It seems if you click "close" button for windows media player while playing it will stay playing
(and disapears from tray or taskbar)

if you open it again it will show up.

Anonymous said...

This is great info to know.

Anonymous said...

does anyone know how to keep windows media player closed when you choose a new song?