WinAPI: MessageBeep - 播放一个系统声音
2009-08-20 16:22
429 查看
/// <summary>
/// 调用系统声音
/// </summary>
/// <param name="wType">类型</param>
/// <returns></returns>
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "MessageBeep")]
public static extern int MessageBeep(int wType);
//参数
//private const int MB_ICONASTERISK = 0x40;
private const int MB_ICONSTOP = 16; // Critical message; displays STOP icon.
private const int MB_ICONQUESTION = 32; // Warning query; displays ? icon.
private const int MB_ICONEXCLAMATION = 48; // Warning message; displays ! icon.
private const int MB_ICONINFORMATION = 64; // Information message; displays i icon.
private const int MB_OK = 0; // OK button only
private const int MB_OKCANCEL = 1; // OK and Cancel buttons
private const int MB_ABORTRETRYIGNORE = 2; // Abort, Retry, and Ignore buttons
private const int MB_YESNOCANCEL = 3; // Yes, No, and Cancel buttons
private const int MB_YESNO = 4; // Yes and No buttons
private const int MB_RETRYCANCEL = 5; // Retry and Cancel buttons
private const int MB_APPLMODAL = 0; // Application Modal Message Box
private const int MB_DEFBUTTON1 = 0; // First button is default
private const int MB_DEFBUTTON2 = 256; // Second button is default
private const int MB_DEFBUTTON3 = 512; // Third button is default
private const int MB_SYSTEMMODAL = 4096; // System Modal
private void button7_Click(object sender, EventArgs e)
{
MessageBeep(MB_ICONASTERISK);
}
/// 调用系统声音
/// </summary>
/// <param name="wType">类型</param>
/// <returns></returns>
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "MessageBeep")]
public static extern int MessageBeep(int wType);
//参数
//private const int MB_ICONASTERISK = 0x40;
private const int MB_ICONSTOP = 16; // Critical message; displays STOP icon.
private const int MB_ICONQUESTION = 32; // Warning query; displays ? icon.
private const int MB_ICONEXCLAMATION = 48; // Warning message; displays ! icon.
private const int MB_ICONINFORMATION = 64; // Information message; displays i icon.
private const int MB_OK = 0; // OK button only
private const int MB_OKCANCEL = 1; // OK and Cancel buttons
private const int MB_ABORTRETRYIGNORE = 2; // Abort, Retry, and Ignore buttons
private const int MB_YESNOCANCEL = 3; // Yes, No, and Cancel buttons
private const int MB_YESNO = 4; // Yes and No buttons
private const int MB_RETRYCANCEL = 5; // Retry and Cancel buttons
private const int MB_APPLMODAL = 0; // Application Modal Message Box
private const int MB_DEFBUTTON1 = 0; // First button is default
private const int MB_DEFBUTTON2 = 256; // Second button is default
private const int MB_DEFBUTTON3 = 512; // Third button is default
private const int MB_SYSTEMMODAL = 4096; // System Modal
private void button7_Click(object sender, EventArgs e)
{
MessageBeep(MB_ICONASTERISK);
}
相关文章推荐
- WinAPI: MessageBeep - 播放一个系统声音
- 播放系统声音
- iOS播放音乐与播放系统声音
- 播放系统声音&震动&系统声音对照表
- WinAPI: waveOutPrepareHeader - 准备一个波形数据块用于播放
- IDirectSoundBuffer Play 播放一个很短的声音,发现总是不结束
- Swift - 制作一个录音机(声音的录制与播放)
- iOS 播放系统声音
- Android播放系统声音源码
- WinXP系统在播放音乐是没有声音怎么解决
- windows 重装系统 声音不能播放怎么办
- 在WinCE上播放声音、设置透明图片、系统音量 C#
- i os 系统震动 和 播放系统声音
- 【转载】iOS播放系统声音
- win7 64位系统使用百度影音播放视频没声音没画面的故障原因及解决方法
- 在编写flash游戏播放声音时的一个要注意的地方
- iOS播放系统声音
- android播放系统闹钟声音-by TomHawk
- 关闭系统声音也可以播放出声音
- iOS 播放系统声音&系统声音大全