Attachment 94187
What did i do wrong ?
PHP Code:
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("winmm.dll")> Shared Function PlaySound(ByVal szSound As String, ByVal hModule As UIntPtr, ByVal fdwSound As Integer) As Integer
End Function
<DllImport("winmm.dll", SetLastError:=True)> Shared Function waveOutGetNumDevs() As Integer
End Function
<Flags()>
Public Enum SoundFlags As Integer
SND_SYNC = &H0
SND_ASYNC = &H1
SND_NODEFAULT = &H2
SND_MEMORY = &H4
SND_LOOP = &H8
SND_NOSTOP = &H10
SND_PURGE = &H40
SND_NOWAIT = &H2000
SND_ALIAS = &H10000
SND_FILENAME = &H20000
SND_RESOURCE = &H40004
End Enum
Private Sub Play(ByVal path As String)
PlaySound(path, UIntPtr.Zero, SoundFlags.SND_FILENAME Or SoundFlags.SND_NOSTOP)
End Sub
Public Function rtrnsnd(ByVal filename As String) As Object
Return My.Resources.ResourceManager.GetObject(filename.ToString)
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Play(rtrnsnd("bin"))
End Sub
End Class