Link to home
Start Free TrialLog in
Avatar of drav_i
drav_i

asked on

BEEEEEEEEEEEP

While Giving a Message i want give a sound to the user .... How th Do it..... Pls Hlp
Avatar of Cimperiali
Cimperiali
Flag of Italy image

Private sub SaySomething()
  Beep
  msgbox "Your message"
End Sub

ASKER CERTIFIED SOLUTION
Avatar of Cimperiali
Cimperiali
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Option Explicit
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

Private Sub Command1_Click()
Beep 1000, 1000
End Sub

Avatar of y2ksw
y2ksw

Additional Beep info:

Windows NT:

The Beep function is synchronous in all but one case; the function does not generally return control to its caller until the sound finishes. The exception to this occurs when dwDuration has the value  - 1. In that case, Beep is asynchronous, returning control immediately to its caller while the sound continues playing. The sound continues until the next call to Beep.

Windows 95:

The Beep function ignores the dwFreq and dwDuration parameters. On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep.
Hi drav_i,
This old question (QID 20566251) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.