Results 1 to 6 of 6

Thread: Wave Files in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9

    Question

    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

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Location
    Fort Lauderdale, FL USA
    Posts
    112
    How about using Micro$oft Multimedia Control and playing the wave file when the form loads.
    Damonous

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9

    Question

    What is a Multimedia control? And where will I find it in the toolbox?


  4. #4
    Lively Member
    Join Date
    Mar 2000
    Location
    Fort Lauderdale, FL USA
    Posts
    112
    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.
    Damonous

  5. #5
    Lively Member
    Join Date
    Mar 2000
    Location
    Fort Lauderdale, FL USA
    Posts
    112
    Sorry, wrong URL. That's for Foxpro.

    Try this one instead:
    http://msdn.microsoft.com/library/de...mcicontrol.htm
    Damonous

  6. #6
    Guest
    Instead of using a Multimedia Control, it's much easier just to use an API called sndPlaySound.

    Put the following code in a module.

    Code:
    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Now put this into the Form's Activate event.

    Code:
    Call sndPlaySound("C:\MyWavFile.wav", &H1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width