Most of the people on Windows Platform, will be using Media Player .It is having lot of features. But, still some features that are required are missing in it. It won't support features like hiding, topmost, default songs loading, enhanced recently played list, easy navigation of songs etc. I think it's better to design an application that will make playing of songs easier. So, I developed an application in VS.NET 2005 using C# and Windows Forms. I will explain features provided by this application followed by its design and coding.

Features present in this application:

Now, create a new Windows Application using C# in VS.NET 2005 and name it as MediaPlayer. Add controls to Main Form (MediaPlayer) as shown below:

Here, I set following properties of MediaPlayer Form:

MainMenuStrip --> menuStrip1
ShowInTaskBar --> false
TopMost --> true

And I placed a Menu, contextMenu, openFileDialog, NotifyIcon followed by a timer. Contextmenu is assigned to NotifyIcon (to display list of recent played songs in Taskbar).

Following are the menu items present in MainMenu (optionsToolStripMenuItem):

Various function of the controls are:

Now, I will explain coding part of this application:

I used following COM Libraries AxWMPLib, WMPLib.

Form_Load:

In Form_Load, I will load recently selected songs present in List.txt file.This file will be created,whenever you select a song in the player for playing. If any line in List.txt starts with "----", it is considered as default Songs Path. Usually,We use to keep all the songs in our system in one or two folders for easy navigation.This folders are called as default songs path.If we enter those paths in the player,it will automatically load all those songs into player for easy navigation.This default songs path will be having lot of songs(around 1000),which consume lot of time to load into player. Inorder to compensate this, we are going to load those songs on a separate thread.

Form_Closed:

In Form_Closed, We are going to write all recently played songs back to the file for later use. And, thread to load default songs will be killed, if it is still alive.

We are using getDirs(),getFiles() methods recursively to load all songs present in Default Songs path.

Finally, we are using Invoke() method to add items to Default Songs List Menuitem.Since,We cant add items to a control directly,which is been created by another thread(Main thread).

Just set default songs path of your system separated by ";" for each path (like C:\songs\;c:\New Songs\ and press Enter) in textbox present in Set Default Songs Path menuitem. That's it, it will load all songs in that path completely with easy navigation into the player.

Finally, I added some code to enhance UI of the application. And, the final output will be like this:

We can access recently played songs by clicking NotifyIcon present in taskbar. We can hide the player by double clicking the NotifyIcon.

We can still enhance this application by improving UI.

By using this application, we can easily play songs without any extra effort in browsing system for songs. Now, playing songs is just a click away from you. I am attaching source code for further reference. I hope this code will be useful for all.