Click here to Skip to main content
15,915,800 members
Home / Discussions / C#
   

C#

 
GeneralRe: Container Controls/User Controls Pin
duncanmeech8-May-03 7:42
duncanmeech8-May-03 7:42 
GeneralNavigation Bar Pin
mrc_ita8-May-03 6:31
mrc_ita8-May-03 6:31 
Questionvs2003-- where's the beef? Pin
allancto8-May-03 5:16
allancto8-May-03 5:16 
AnswerRe: vs2003-- where's the beef? Pin
Kevin McFarlane8-May-03 6:50
Kevin McFarlane8-May-03 6:50 
GeneralRe: vs2003-- where's the beef? Pin
Daniel Turini8-May-03 7:55
Daniel Turini8-May-03 7:55 
GeneralRe: vs2003-- where's the beef? Pin
Kevin McFarlane8-May-03 8:25
Kevin McFarlane8-May-03 8:25 
GeneralRe: vs2003-- where's the beef? Pin
Daniel Turini8-May-03 8:35
Daniel Turini8-May-03 8:35 
GeneralRe: vs2003-- where's the beef? Pin
James T. Johnson8-May-03 22:57
James T. Johnson8-May-03 22:57 
AnswerRe: vs2003-- where's the beef? Pin
David Stone8-May-03 7:39
sitebuilderDavid Stone8-May-03 7:39 
AnswerRe: vs2003-- where's the beef? Pin
Wesner Moise19-May-03 19:41
Wesner Moise19-May-03 19:41 
Generalwriting strings to the browser control Pin
LongRange.Shooter8-May-03 3:50
LongRange.Shooter8-May-03 3:50 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.8-May-03 5:13
Stephane Rodriguez.8-May-03 5:13 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter9-May-03 5:30
LongRange.Shooter9-May-03 5:30 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 6:25
Stephane Rodriguez.9-May-03 6:25 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter9-May-03 10:11
LongRange.Shooter9-May-03 10:11 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 10:25
Stephane Rodriguez.9-May-03 10:25 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter9-May-03 10:37
LongRange.Shooter9-May-03 10:37 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 10:58
Stephane Rodriguez.9-May-03 10:58 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter12-May-03 4:25
LongRange.Shooter12-May-03 4:25 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.12-May-03 4:35
Stephane Rodriguez.12-May-03 4:35 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter15-May-03 7:37
LongRange.Shooter15-May-03 7:37 
Generalmp3 in C# Pin
Anonymous8-May-03 3:47
Anonymous8-May-03 3:47 
GeneralRe: mp3 in C# Pin
Paresh Gheewala8-May-03 7:01
Paresh Gheewala8-May-03 7:01 
GeneralRe: mp3 in C# Pin
AlexDunn19-May-03 14:14
AlexDunn19-May-03 14:14 
GeneralRe: mp3 in C# Pin
Paresh Gheewala21-May-03 5:49
Paresh Gheewala21-May-03 5:49 
if you are trying to run the audio file.
herez the sample for you.
(the sample for playing the audio files
without any GUI)

u might consider running it in threads if u need

check the sample.
using
winmm.dll

[DllImport("winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, long dwFlags);

-----------------check the following code------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
using System.IO;

namespace WinMediaPlayer
{
///
/// Summary description for Form1.
///

public class Form1 : System.Windows.Forms.Form
{
[DllImport("winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, long dwFlags);

private System.Windows.Forms.Button buttonPlay;
private System.Windows.Forms.Label labelFile;
private System.Windows.Forms.TextBox textBoxAudioFile;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.buttonPlay = new System.Windows.Forms.Button();
this.labelFile = new System.Windows.Forms.Label();
this.textBoxAudioFile = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonPlay
//
this.buttonPlay.Location = new System.Drawing.Point(128, 80);
this.buttonPlay.Name = "buttonPlay";
this.buttonPlay.Size = new System.Drawing.Size(96, 32);
this.buttonPlay.TabIndex = 0;
this.buttonPlay.Text = "Play";
this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click);
//
// labelFile
//
this.labelFile.Location = new System.Drawing.Point(8, 24);
this.labelFile.Name = "labelFile";
this.labelFile.Size = new System.Drawing.Size(80, 24);
this.labelFile.TabIndex = 1;
this.labelFile.Text = "File To Play";
//
// textBoxAudioFile
//
this.textBoxAudioFile.Location = new System.Drawing.Point(112, 24);
this.textBoxAudioFile.Name = "textBoxAudioFile";
this.textBoxAudioFile.Size = new System.Drawing.Size(328, 20);
this.textBoxAudioFile.TabIndex = 2;
this.textBoxAudioFile.Text = "Path to Audio File";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(424, 141);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBoxAudioFile,
this.labelFile,
this.buttonPlay});
this.Name = "Form1";
this.Text = "Windows Media Player ";
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void buttonPlay_Click(object sender, System.EventArgs e)
{
// Codes used
// where Asynchronously = 0x0001,
// where NoWait = 0x00002000,
// where Filename = 0x00020000,

if(File.Exists(textBoxAudioFile.Text))
{
PlaySound(textBoxAudioFile.Text, 0,0x0001|0x00020000|0x00002000);
}
}
}
}
----------------------------------------------------

hope this helps you
-Paresh;);););P;P;P

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.