Leif,
It should be noted that instead of using interop, you can use the static
Beep method on the Interaction class in the Microsoft.VisualBasic namespace,
which is located in Microsoft.VisualBasic.dll. This does the declaration
for you, and acts in exactly the same manner as it would in VB (and is
distributed as part of the framework).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Leif Andersson said:
Invoke
to
call the Win32 Beep API function. Use the following DllImport attribute:
[DllImport("kernel32.dll", EntryPoint="Beep")]
public static extern bool Beep(int frequency, int duration);
Regards,
Joe
Hi All!
A simple question; what is the C# equivalent for Beep() in VB?
And how can I use the system sound from C#?
Thanks in advance!
/Leif Andersson