Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
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
GeneralRe: mp3 in C# Pin
AlexDunn21-May-03 12:04
AlexDunn21-May-03 12:04 
GeneralRe: mp3 in C# Pin
leppie8-May-03 7:34
leppie8-May-03 7:34 
GeneralRe: mp3 in C# Pin
Kant8-May-03 8:23
Kant8-May-03 8:23 
GeneralRe: mp3 in C# Pin
leppie8-May-03 10:16
leppie8-May-03 10:16 
GeneralRe: mp3 in C# Pin
jtmtv189-May-03 19:05
jtmtv189-May-03 19:05 
GeneralLarge File Transfer in Client-Server Applications Pin
Vasant Salian8-May-03 1:28
Vasant Salian8-May-03 1:28 
GeneralRe: Large File Transfer in Client-Server Applications Pin
Katalyst8-May-03 4:55
Katalyst8-May-03 4:55 
Questionwhat you must add to your exe file Pin
flyingv7-May-03 19:56
flyingv7-May-03 19:56 
AnswerRe: what you must add to your exe file Pin
Stephane Rodriguez.7-May-03 20:03
Stephane Rodriguez.7-May-03 20:03 
QuestionHandle for a child window? Pin
lxhan7-May-03 17:26
lxhan7-May-03 17:26 
AnswerRe: Handle for a child window? Pin
Stephane Rodriguez.7-May-03 20:00
Stephane Rodriguez.7-May-03 20:00 
AnswerRe: Handle for a child window? Pin
LongRange.Shooter9-May-03 10:44
LongRange.Shooter9-May-03 10:44 
QuestionC++ define statements == what in C#? Pin
dazinith7-May-03 9:38
dazinith7-May-03 9:38 
AnswerRe: C++ define statements == what in C#? Pin
RB@Emphasys7-May-03 9:45
RB@Emphasys7-May-03 9:45 
GeneralRe: C++ define statements == what in C#? Pin
dazinith7-May-03 9:54
dazinith7-May-03 9:54 
GeneralRe: C++ define statements == what in C#? Pin
leppie8-May-03 10:22
leppie8-May-03 10:22 
GeneralRe: C++ define statements == what in C#? Pin
Kevin McFarlane9-May-03 1:00
Kevin McFarlane9-May-03 1:00 

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.