Results 1 to 2 of 2

Thread: I am kinda new... How do you add sounds?

  1. #1
    Guest

    Lightbulb

    How do you make it so when i click a button, it plays a wav. sound? for example... when i click cmdPlaySound, i want to hear "c:\windows\media\chimes.wav"

    Code please?

    Thanks a lot

  2. #2
    Guest
    Put this into a module:

    Code:
    Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    
    Public Const SND_ASYNC = &H1
    And then use this code:
    Code:
    Dim strFileName As String
    strFileName = "C:\WINDOWS\CHIMES.WAV"
    PlaySound strFileName, 0, SND_ASYNC
    Hope this helps...

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