Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Beep plays a sound, but its exact behavior varies between platforms. Windows 95/98: The function always plays the SystemDefault system sound, regardless of the values passed to the function. Windows NT/2000: The function plays a tone through the computer's internal speaker at the desired frequency for a specified duration.
If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.
None
' This code is licensed according to the terms and conditions listed here.
' Attempt to play a note at 800 Hz for 2 seconds. This will only
' behave this way on Windows NT/2000; users of Windows 95/98 will only hear the
' default sound.
Dim retval As Long ' return value
retval = Beep(800, 2000) ' ideally, an 800 Hz tone for 2 seconds
Go back to the alphabetical Function listing.
Go back to the Reference section index.
Last Modified: July 26, 1999
This page is copyright © 1999 Paul Kuliniewicz.
Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/b/beep.html