Very simple.
I used sndPlaySound API; you can (maybe should) use the newer version, PlaySound.
I aliased it to accept a byte array for first argument (as Any).
In general declaration section:
Code:
Declare Function xsndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (SoundVar As Any, ByVal uFlags As Long) As Long
Dim mbellsoundarr() As Byte
In form load:
Code:
mbellsoundarr = LoadResData("BELL", "CUSTOM")
To play my bell sound I call PlayBellSound. Here's the Sub:
Code:
Private Sub PlayBellSound()
xsndPlaySound mbellsoundarr(0), 5
End Sub
The 5 for flags is a combination of SND_ASYNC and SND_MEMORY.
|
__________________
It looks like ketchup; it tastes like ketchup; but brother, it ain't ketchup!
|