title: How to Play a music in the background vb6?
body: <p>hi i make a small game with vb6 and i need play 2 sound in some time 
  i use this code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code> Private Declare Function PlaySoundMem Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As Long, ByVal hModule As Long, ByVal dwFlags As Long) As Long
      Const SND_ASYNC = &amp;H1, SND_MEMORY = &amp;H4, SND_NODEFAULT = &amp;H2, SND_NOSTOP = &amp;H1, SND_NOWAIT = &amp;H2000
  Dim Sound() As Byte
  Dim x As Integer
  
  Private Sub Form_Load()
  On Error Resume Next
  Sound = LoadResData("music", "CUSTOM")
  Call PlaySoundMem(VarPtr(Sound(0)), 0, SND_NOWAIT Or SND_NODEFAULT Or SND_MEMORY Or SND_ASYNC Or SND_NOSTOP)
  DoEvents
  
  End Sub
  
  Private Sub snd()
  If nrd.Text = 1 Then
  x = 1
  snd_hero
  ElseIf nrd.Text = 2 Then
  x = 2
  snd_hero
  ElseIf nrd.Text = 3 Then
  x = 3
  snd_hero
  ElseIf nrd.Text = 4 Then
  x = 4
  snd_hero
  ElseIf nrd.Text = 5 Then
  x = 5
  snd_hero
  ElseIf nrd.Text = 6 Then
  x = 6
  snd_hero
  End If
  End Sub
  
  Private Sub snd_hero()
  On Error Resume Next
  Sound = LoadResData(x, "CUSTOM")
  Call PlaySoundMem(VarPtr(Sound(0)), 0, SND_NOWAIT Or SND_NODEFAULT Or SND_MEMORY Or SND_ASYNC Or SND_NOSTOP)
  DoEvents
  ReDim Sound(0)</code></pre>
  </div>
  </div>
  
  its play music whin game start but the music stop whin play another sound 
  i need play to sound at some time what i do thanks</p>