Visual Basic - Technik, FAQ, Tricks, Beispiele

Home / System / Multimedia / PlaySound

PlaySound

Impressum
Kontakt
DSVGO
Mit Hilfe der unten gezeigten Prozedur "PlaySound" können Wave-Dateien abgespielt werden:
'Deklarationsteil:
Private Declare Function sndPlaySoundA Lib "winmm.dll" ( _
    ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

'Prozedur:
Sub PlaySound(ByVal Path As String)
  sndPlaySoundA Path, 1&
End Sub
Im folgenden Beispiel gibt es bei jedem Klick auf das Formular einen kleinen Applaus:
Private Sub Form_Click()
  PlaySound "C:\WINNT\Media\Office97\Applaus.wav"
End Sub

© Jost Schwider, 14.10.2000-14.10.2000 - http://vb-tec.de/playsnd.htm