.wav on form load

Dave Titan

Registered User.
Local time
Today, 05:37
Joined
Jan 1, 2002
Messages
69
On the splash screen I'd like a .wav to play.

This db is used over a server so it needs to be linked in via code.

Anyone got some code for this?

I've tried some code I got elsewhere but to no avail.
 
Try this:

In a module declare this function:

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


Then, when you want to play a .wav use this line:

sndPlaySound "MyFile.wav", 1


where, of course "MyFile.wav" is the name of your .wav file and the 1 indicates that the program should not stop while playing the sound. If you want the program to stop while it plays the saound then you can send a 0 to the sndPlaySound function instead.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom