Saturday, March 22, 2008

How to Beep PC with API and VB

Today I will post code still related windows API function with VB. Now, I will show you how to beep the PC with the code on VB

First, we need declare an API function on VB:

Public Declare Function Beep Lib “kernel32” (ByVal dwFreq as Long, ByVal dwDuration As Long) As Long

That’s it. We just need it only to beep the PC.

Now, how to use on VB code:


Private Sub Command1_Click()
Dim x As Byte

For y = 1 to 100

Beep y,100

Next

End Sub

It will beep 100 times with 100 durations.

Okay. Enjoy the Code….




0 comments:

Google

Microsoft News for ADO .NET:

Our Email Address:

blog.programming@gmail.com