Beep plays a sound on the computer, but its behavior varies markedly between Win NT and Win 95/98. On Win NT, a tone is played in the specified frequency for a specified length of time. On Win 95/98, the function's two parameters are ignored completely and the function merely plays the SystemDefault sound. The function returns 1 if successful, or 0 if an error occured.
Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long
On Win NT, specifies the frequency, in hertz (Hz), of the tone to play. On Win 95/98, this parameter is ignored.
On Win NT, specifies the duration, in milliseconds, to play the desired tone. On Win 95/98, this parameter is ignored.
Dim retval As Long
retval = Beep(800, 2000)