111,126
社区成员
发帖
与我相关
我的任务
分享 private void PlayMusic()
{
string szSound = string.Empty;
szSound = "SOUND.WAV";
PlaySound(szSound, IntPtr.Zero, PlaySoundFlags.SND_FILENAME | PlaySoundFlags.SND_ASYNC);
}
[DllImport("winmm")]
public static extern bool PlaySound(string szSound, IntPtr hMod, PlaySoundFlags flags);
public enum PlaySoundFlags
{
SND_ALIAS = 0x10000,
SND_ALIAS_ID = 0x110000,
SND_ASYNC = 1,
SND_FILENAME = 0x20000,
SND_LOOP = 8,
SND_MEMORY = 4,
SND_NODEFAULT = 2,
SND_NOSTOP = 0x10,
SND_NOWAIT = 0x2000,
SND_RESOURCE = 0x40004,
SND_SYNC = 0
}