Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...

Listening to a Hidden Media Player

Author: Bob Swart
Posted: 8/29/2005 2:13:11 PM (GMT+1)

I sometimes like to listen to the radio while working, and a lot of my favorite radio stations are available on the internet as ASX streams. This means that Microsoft Media Player can play them for me. However, the Media Player remains visible (playing one of these distracting "visualisation themes"), and even when I minimize it, I can still see the Media Player button in the Task Bar. Personally, I'd prefer to have it show up only as a Tray Icon when playing internet radio.

Today, it annoyed me enough to try to hide it, so I wrote a little Delphi app to hide it from sight. The simple source code is as follows:

program HideMP;
H: HWnd;
H := FindWindow(nil, 'Windows Media Player');
ShowWindow(H, SW_HIDE);

It sure hides the Media Player window from sight as well as the Task Bar!

A minor disadvantage is that it's also no longer visible using Alt+Tab, so it's a bit hard to shut down. Fortunately, playing another file (that has a shortcut to Media Player), or just starting Media Player (again) will make it appear again. Or I could make a similar version of HideMP, but then send a SW_SHOW to the Window manually.

With Delphi's help, I'm happy listening to internet radio again (without any distracting visual stuff).



Dick Boogaers05/08/31 12:27:51Hi Bob, There is a nice freeware package for these kind of things: "4t Tray Minimizer" ( It minimizes anything you want to the system tray. Dick Boogaers
Bob Swart05/08/31 17:07:51Hmm... Well, but that one wasn't "invented here", of course ;-)

New Comment (max. 2048 characters, no HTML):


This webpage © 2005-2014 by Bob Swart (aka Dr.Bob - All Rights Reserved.