Ho hum.... so boring... Try this instead:
1. Install DirectX 9.0 SDK
2. Create a Windows Forms application
3. Add a reference to Microsoft.DirectX.DirectSound
4. Add the following code:
using Microsoft.DirectX.DirectSound;
....
private void button1_Click(object sender, System.EventArgs e)
{
Device dev = new Device();
dev.SetCooperativeLevel(this,CooperativeLevel.Norm al);
BufferDescription buffer_desc = new BufferDescription();
SecondaryBuffer buffer = new SecondaryBuffer(
@"C:\WINDOWS\Media\ding.wav",
buffer_desc,
dev);
buffer.Play(0,BufferPlayFlags.Default);
}
Or use any wav file you like -- Live a little!!!!
- Harlow.
"Ido Samuelson" wrote:
[DllImport("kernel32.dll")]
public static extern bool Beep(int freq,int duration);
Best Regards,
Ido Samuelson
Senior Consultant
Advantech – Microsoft Division (Magen)
id**@advantech.co.il
http://www.magen.com
"Paul DeWitt" <Pa********@discussions.microsoft.com> wrote in message news:74**********************************@microsof t.com...
I am new to .net and C#. Is there a way to initiate a default beep sound
effect?
Thanks