Click to See Complete Forum and Search --> : How to invoke message beep in C#?


cyberninja
June 18th, 2002, 01:53 PM
Either in calling C# APIs or invoking Win32 API - I am new for C#.


Thanks,

Ming

StephaneDaigle
June 27th, 2002, 11:12 AM
You can call the API in C# like this:

using System.Runtime.InteropServices;

class ...
{
[DllImport("kernel32.dll")]
public static extern bool Beep(int Frequency, int Duration);

public SomeFunctionToBeep ...
{
Beep(250, 250);
}

}

Enjoy!