Hi CM
play sound is an API function . It is in the user32.dll file so you do a
platfom invocation to call it . to do so , you use the DLLImport attribute
with the relative arguments , then define the function as external . once
you have done so , you can use it from your code while passing to it the
file that you want to play
here is an exmple code of a c# program that show who
to use this function
First include this namespace
using System.Runtime.InteropServices;
then define the import attribute and the extern function as
follows ( you can do that any where in your program )
[DllImport("winmm.dll", EntryPoint="PlaySound")]
public static extern bool PlaySound_DllImport(string
pszSound,IntPtr hmod ,int fdwSound );
define its pram and use it as follows
bool result;
System.IntPtr resourceHandle = System.IntPtr.Zero;
result = PlaySound_DllImport("c:\\somefile.mpc3",resourceHa ndle,0);
you can read more about the function on the msdn online site
hope that would help
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC