|
VB 4/6- und VBA-Forum - Beitragsübersicht - |
|
Von |
Lexx24 |
Datum |
01. September 2017 um 20:02:45 |
Frage |
Hallo VB-Fans,
ein Problem hätte ich da noch. Ich möchte einen Sound aus einer Resource abspielen.
Funktioniert wie folgt auch wunderbar, BeginPlaySound 11. Mit „EndPlaySound“ kann ich auch den Sound vorzeitig beenden.
Nun zum Problem: Ich bräuchte eine Mitteilung wann ein Sound sein Ende erreicht hat.
Option Explicit #If Win32 Then Declare Function sndPlaySound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As Any, ByVal uFlags As Long) As Long #Else Declare Function sndPlaySound Lib "MMSYSTEM.DLL" (ByVal lpszSoundName As Any, ByVal wFlags As Integer) As Integer #End If Public Sub BeginPlaySound(ByVal ResourceId As Integer) ' Sound abspielen Dim ret As Variant #If Win32 Then SoundBuffer = StrConv(LoadResData(ResourceId, "WAVESOUND"), vbUnicode) #Else SoundBuffer = LoadResData(ResourceId, "WAVESOUND") #End If ret = sndPlaySound(SoundBuffer, SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY) DoEvents End Sub Public Sub EndPlaySound() ' Sound Ende Dim ret As Variant ret = sndPlaySound(0&, 0&) End Sub
Liebe Grüße Lexx24
|
|
[ Antwort schreiben | Zurück zum VB 4/6- und VBA-Forum | Forum-Hilfe ] |
|
Letzte Aktualisierung: Sonntag, 13. Dezember 2015 |
|