Results 1 to 6 of 6

Thread: How to play wav file on clicking on a picture

Threaded View

  1. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: How to play wav file on clicking on a picture

    I had PlaySound snippet handy so here we go:
    Code:
    Option Explicit
    
    Private Const SND_FILENAME = &H20000
    Private Const SND_ASYNC = &H1
    
    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
        (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    
    Private Sub Picture1_Click()
        PlaySound "C:\Windows\Media\ding.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
    End Sub

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