Tuesday, December 9, 2008

Computer beep using API

Imports System.Runtime.InteropServices


'put this code just below the class level

CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function _
aBeep(ByVal dwFreq As Integer, ByVal dwDuration As Integer) _
As Boolean
' Leave the body of the function empty.
End Function


'now make a call to the Function with Frequency
'and Duration parameters. Can be used anywhere you want
'to alert the user.

aBeep(1000, 500)
aBeep(2000, 1000)

No comments: