-
Notifications
You must be signed in to change notification settings - Fork 0
/
UtilityBeep.cs
62 lines (55 loc) · 1.55 KB
/
UtilityBeep.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Runtime.InteropServices;
namespace WordEngineering
{
/// <summary>UtilityBeep.</summary>
/// <remarks>http://blogs.msdn.com/brada/archive/2004/06/03/148142.aspx Brad Abrams : MessageBeep in the .NET Framework</remarks>
public class UtilityBeep
{
/// <summary>MessageBeepType</summary>
public enum MessageBeepType
{
/// <summary>Default</summary>
Default = -1,
/// <summary>OK</summary>
Ok = 0x00000000,
/// <summary>Error</summary>
Error = 0x00000010,
/// <summary>Question</summary>
Question = 0x00000020,
/// <summary>Warning</summary>
Warning = 0x00000030,
/// <summary>Information</summary>
Information = 0x00000040,
}
/// <summary>MessageBeep</summary>
[DllImport("user32.dll", SetLastError=true)]
public static extern bool MessageBeep
(
MessageBeepType type
);
/// <summary>MessageBeep</summary>
[DllImport("kernel32.dll")]
public static extern bool Beep
(
int freq,
int duration
);
/// <summary>The entry point for the application.</summary>
/// <param name="argv">A list of command line arguments</param>
public static void Main
(
String[] argv
)
{
System.Console.Beep();
//Microsoft.VisualBasic.Interaction.Beep();
//MessageBeep( MessageBeepType.Information );
//Beep( 800, 200 );
//System.Console.WriteLine("\a");
}//public static void Main()
static UtilityBeep()
{
}//static UtilityBeep()
}//public class UtilityBeep
}//namespace WordEngineering