Private Declare Function mciSendStringB Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer Dim FileN As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If OpenFileDialog1.ShowDialog() = DialogResult.OK Then FileN = OpenFileDialog1.FileName End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Call mciSendStringB(String.Format("open ""{0}"" alias MySound", FileN), "", 0, 0) Call mciSendStringB("play MySound", "", 0, 0) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Call mciSendStringB("stop MySound", "", 0, 0) Call mciSendStringB("close MySound", "", 0, 0) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Call mciSendStringB("pause MySound", "", 0, 0) End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Call mciSendStringB("resume MySound", "", 0, 0) End Sub