Originally posted by Frans C
Iouri, you made some mistakes in converting the API declaration to VB.NET. All Long's must be integers, so the declaration must be:

VB Code:
  1. Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer

You are right for .NET it must be Integer. But it also works with Long. Tried it just now