title: c# Detecting when a music file has stopped playing in the WMPLib
body: <p>I need to know when a music file has stopped playing to play the next song in a playlist string array I made.</p>
  
  <p>I use the WMPLib and here is my code to get the song playing:</p>
  
  <p><a href="https://gyazo.com/993d8ea2dff20316f6c98ff88ab57394" rel="nofollow">https://gyazo.com/993d8ea2dff20316f6c98ff88ab57394</a>
  <code>
  + under a button event I use</code>PlayFile(@playlist[0]);`</p>
  
  <p>Also I realised I have a memory leak so if someone just happened to also know the code for fixing that for every song that would be cool.</p>