I ilPostino Nov 2, 2003 #1 Does anyone know how to play system sounds? Or to install your own sounds and then call them from the application? C
Does anyone know how to play system sounds? Or to install your own sounds and then call them from the application? C
J Jeff Gaines Nov 2, 2003 #2 Does anyone know how to play system sounds? Or to install your own sounds and then call them from the application? C Click to expand... Try: // PlaySound [DllImport("winmm.DLL", EntryPoint="PlaySound", SetLastError=true, CallingConvention=CallingConvention.StdCall)] public static extern bool PlaySound(string strSound, IntPtr hModule, int dwFlags); public enum SoundFlag : int { SND_APPLICATION = 0x80, SND_ALIAS = 0x10000, SND_ALIAS_ID = 0x110000, SND_ASYNC = 0x1, SND_SYNC = 0x0, SND_FILENAME = 0x20000, SND_LOOP = 0x8, SND_MEMORY = 0x4, SND_NODEFAULT = 0x2, SND_NOSTOP = 0x10, SND_NOWAIT = 0x2000, SND_PURGE = 0x40, SND_RESOURCE = 0x40004, } PlaySound(@"D:\Sounds\Fanfare.wav", IntPtr.Zero, SoundFlag.SND_FILENAME);
Does anyone know how to play system sounds? Or to install your own sounds and then call them from the application? C Click to expand... Try: // PlaySound [DllImport("winmm.DLL", EntryPoint="PlaySound", SetLastError=true, CallingConvention=CallingConvention.StdCall)] public static extern bool PlaySound(string strSound, IntPtr hModule, int dwFlags); public enum SoundFlag : int { SND_APPLICATION = 0x80, SND_ALIAS = 0x10000, SND_ALIAS_ID = 0x110000, SND_ASYNC = 0x1, SND_SYNC = 0x0, SND_FILENAME = 0x20000, SND_LOOP = 0x8, SND_MEMORY = 0x4, SND_NODEFAULT = 0x2, SND_NOSTOP = 0x10, SND_NOWAIT = 0x2000, SND_PURGE = 0x40, SND_RESOURCE = 0x40004, } PlaySound(@"D:\Sounds\Fanfare.wav", IntPtr.Zero, SoundFlag.SND_FILENAME);