MessageBeep in the .NET Framework

This has come by in email a few times, so I thought I’d post it here.  Clearly this is a hole in the V1 and we are addressing it in Whidbey.

Until then:

public enum MessageBeepType
{
    Default = -1,
    Ok = 0x00000000,
    Error = 0x00000010,
    Question = 0x00000020,
    Warning = 0x00000030,
    Information = 0x00000040,
}

[DllImport("user32.dll", SetLastError=true)]
public static extern bool MessageBeep(
    MessageBeepType type
);

 

 

Published 19 July 03 10:40 by BradA
Filed under:

Comments

# Graeme Foster said on July 20, 2003 6:26 AM:
MessageBeep has become truly established as the "Hello, World!" of interop. Take that away, and we'll have to find something else! ;)
# Corrado Cavalli said on July 20, 2003 5:56 PM:
As soon as you'll add MessageBeep I'm sure you'll start receiving request for PlayWaveFile so think about it in advance ;-)
# Brad Abrams said on June 3, 2004 11:40 PM:
# Vinit Bhansali said on June 11, 2004 12:05 PM:
Your example helped save the day (and a few extra hours)!

Thanks!
# Brad Abrams [MSFT] said on June 11, 2004 4:06 PM:
I love to hear that -- thanks!
# Carp said on June 28, 2004 12:10 PM:
just goes to show what a total joke .WANK is
New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker