请问win7下如何使用beep()函数让主板发生蜂鸣声.

请问win7下如何使用beep()函数让主板发生蜂鸣声.,第1张

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

Private Sub Command1_Click()

Beep 1000,500 '1000,500 可以自行调增,得到自己想要的声音为止。

'500是'调'节声音的长短

End Sub

using System

using System.Collections.Generic

using System.ComponentModel

using System.Data

using System.Drawing

using System.Linq

using System.Text

using System.Windows.Forms

using System.Runtime.InteropServices

namespace WindowsFormsApplication1

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent()

}

[DllImport("kernel32.dll")]

private static extern int Beep(int dwFreq, int dwDuration)

private void button1_Click(object sender, EventArgs e)

{

Beep(0X7FF, 1000)

}

}

}

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

Private Sub Command1_Click()

Beep 1000,500 '1000,500 可以自行调增,得到自己想要的声音为止。

'500是'调'节声音的长短

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/6653970.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-26
下一篇 2023-03-26

发表评论

登录后才能评论

评论列表(0条)

保存