Created
January 18, 2021 15:24
-
-
Save kakkun61/982227fecfaca0e1b9080b9fe4307e96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Wintellect.Interop.Sound | |
{ | |
using System; | |
using System.Runtime.InteropServices; | |
using System.ComponentModel; | |
sealed class Sound | |
{ | |
public static void MessageBeep(BeepTypes type) | |
{ | |
if (!MessageBeep((UInt32) type)) | |
{ | |
Int32 err = Marshal.GetLastWin32Error(); | |
throw new Win32Exception(err); | |
} | |
} | |
[DllImport("User32.dll", SetLastError=true)] | |
static extern Boolean MessageBeep(UInt32 beepType); | |
private Sound(){} | |
} | |
enum BeepTypes | |
{ | |
Simple = -1, | |
Ok = 0x00000000, | |
IconHand = 0x00000010, | |
IconQuestion = 0x00000020, | |
IconExclamation = 0x00000030, | |
IconAsterisk = 0x00000040 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL MessageBeep( | |
UINT uType // beep type | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DllImport("User32.dll")] | |
static extern Boolean MessageBeep(UInt32 beepType); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment