I'm trying to have a wave file run when a form loads. What is the easiest way to do this? Maybe a OLE & autoActivate property. Thanks
Printable View
I'm trying to have a wave file run when a form loads. What is the easiest way to do this? Maybe a OLE & autoActivate property. Thanks
How about using Micro$oft Multimedia Control and playing the wave file when the form loads.
What is a Multimedia control? And where will I find it in the toolbox?
Which VB version are you using? If you're using VB6 then do this:
1. From the VB IDE, press Control+T.
2. Scroll down until you find Microsoft Multimedia Control
3. Check the box next to it and hit the "OK" button. This will place the control in your tool box.
4. Drag the control onto your form.
5. Go here, http://support.microsoft.com/support.../Q247/0/36.ASP
and learn how to use it.
If you have any other questions. Let me know.
Sorry, wrong URL. That's for Foxpro.
Try this one instead:
http://msdn.microsoft.com/library/de...mcicontrol.htm
Instead of using a Multimedia Control, it's much easier just to use an API called sndPlaySound.
Put the following code in a module.
Now put this into the Form's Activate event.Code:Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Code:Call sndPlaySound("C:\MyWavFile.wav", &H1)