How to play a sound from my program
C#
2
Posts
2
Posters
0
Views
1
Watching
-
I don't know how to play a sound from my program. Example:when i click on button to play a sound. I have Visual Studio 2003. Help.
Vasildb
-
I don't know how to play a sound from my program. Example:when i click on button to play a sound. I have Visual Studio 2003. Help.
Vasildb
Hi Vasildb, put this in a static class: public static bool Play (string filename) { return PlaySound (filename, IntPtr.Zero,0x00020000 |0x0000); } /// /// Plays A sound /// /// /// /// /// [DllImport("winmm.dll", EntryPoint="PlaySound")] private static extern bool PlaySound( string szSound, IntPtr hMod, int flags ); Got it from a forum and work perfect Nassos
GanDad