Visual Basic - Ejecutar sonido en VB6

Life is soft - evento anual de software empresarial
 
Vista:

Ejecutar sonido en VB6

Publicado por Pedro (105 intervenciones) el 05/05/2004 03:56:07
Saludoss, como puedo hacer para ejecutar o activar un sonido de alerta cuando preciono un boton por ejemplo, el sonido tendria que ser como un piiiiiiiiiii, o algo parecido. muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ejecutar sonido en VB6

Publicado por Ruben Olivera (44 intervenciones) el 05/05/2004 20:25:31
Hola pedro, te recomiendo utilizar un wav, y para ejecutar el sonido se utiliza una funcion API, aqui te escribo completamente el codigo: la Funcion la declaras en Modulo:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0 'just after the sound is ended exit function
Const SND_ASYNC = &H1 'just after the beginning of the sound exit function
Const SND_NODEFAULT = &H2 'if the sound cannot be found no error message
Const SND_LOOP = &H8 'repeat the sound until the function is called again
Const SND_NOSTOP = &H10 'if currently a sound is played the function will return without playing the selected sound

Const Flags& = SND_ASYNC Or SND_NODEFAULT

Private Sub Form_Click()
Dim FicheroSonido As String
FicheroSonido = "c:\Ruta del Wav\etereo2.wav"
sndPlaySound FicheroSonido, Flags
End Sub

Ok...socio..Saludos de un Chileno de Corazon...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar