VB Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Int32, ByVal dwFlags As Int32) As Int32
Private Const SND_FILENAME As Int32 = &H20000
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim TotalWinner6 As Integer = 6
If TotalWinner6 = 6 Then
Dim thrd As New Threading.Thread(AddressOf WinnerSound)
thrd.Start() '/// set a new thread to play the sound file ( to allow the message box to show at the same time as the sound plays )
MessageBox.Show("we have a winner!")
End If
End Sub
Private Sub WinnerSound()
PlaySound("C:\WINDOWS\MEDIA\Windows XP Startup.wav", 0, SND_FILENAME)
End Sub