.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> C# >> Post New Resource Bookmark and Share   

 Subscribe to Articles

MultiPlayer in C#

Posted By:Nikhil Kumar       Posted Date: January 12, 2010    Points: 25    Category: C#    URL: http://www.dotnetspark.com  

"Multiplayer" allows you to play all types of audio files and video files too, Developed in C#.NET simple to understand download and enjoy coding and working :)
 

The MutliPlayer user interface developed in Windows Forms liiks like following.

The Browse button let you browse a media file. Play and Pause buttons plays and pauses the media file. Close button closes the application.

If you click on the Picture bytton, a form will open and you can set a picture.

This application uses Win32 winmm.dll. Download and run the attached project for more details.

 

This programm developed in very simple coding.

// Here the simple method to import the Dll file of the wimdows media player for all systems...
  
     [DllImport("winmm.dll")]

 

 //You can't use any other word in place of
            // mciSendString because this is imported from winmm.dll ...
           

            // You can't change the sequence of this initialization (_______)...if u will change this will show the error(s)...

         
        public static extern long mciSendString(string rCommand, StringBuilder rReturn, int back, int length);

 // This is the mouseover event for the browse button this is used for change the size
        // of the button dynamically. . .
        private void BTBROWSE_MouseMove(object sender, MouseEventArgs e)
        {
           
            BTBROWSE.Width = 115;
            BTBROWSE.Height = 40;

            BTBROWSE.BackColor = Color.Red;
            BTBROWSE.ForeColor = Color.DarkTurquoise;
        }


// this is used to browse your mp3 files ...
        private void BTBROWSE_Click(object sender, EventArgs e)
        {

            openFileDialog1.Filter = "Mp3 [.mp3] files |*.mp3|Movie [.avi] files|*.avi|Video [3GP] files|*.3GP|WAV [.wav] files|*.wav|DAT [.DAT] files|*.dat ";
          
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                path.Text = openFileDialog1.FileName;
                Command  = "close Mp3File";
                mciSendString(Command, null, 0, 0);
                timer1.Enabled = false;
                Command = "open " + "\"" + openFileDialog1.FileName + "\"" + " type MPEGVideo alias Mp3File";
                mciSendString(Command, null, 0, 0);
            }

        }
Thanks !

Nikhil Kumar

 Subscribe to Articles

     

Further Readings:

    Responses

    No response found. Be the first to respond this post

    Post Comment

    You must Sign In To post reply
    Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend