注:
  我在Win98中用
  PlaySound(‘Sound’,Hinstance,SND_FILENAME+SND_ASYNC+SND_LOOP);
  可以播放,但在Win2000中却不能播放;
  请问各位大虾,在Win2000中,如何使用PlaySound播放声音资源。
  谢谢。

解决方案 »

  1.   

    Playsound(pchar(gsoundFile),0,SND_FILENAME);
      

  2.   

    sndPlaySound(pchar(FSoundFile), snd_Async or snd_NoDefault)
      

  3.   

    playsound('c:\FINISH.wav',hinstance,SND_FILENAME);
    更详细的看SDK吧
      

  4.   

    PlaySound(PChar(FileName),SND_ASYNC+SND_LOOP);
      

  5.   

    可以用!可以用!可以用!可以用!
    PlaySound(PChar(ExtractFilePath(Application.ExeName)+'Sound/folder.wav'),0,SND_FILENAME or SND_ASYNC);
      

  6.   

    playsound('A',hInstance,SND_ASYNC);
    A.res是已经使用a.rc描述并编译过的资源文件,并在Application的开头加上
    {$R *.res}
      

  7.   

    在implication下补上{$R wave.res}
    然后比如有声音文件DING.wav
    PlaySound('DING',hInstance,SND_RESOURCE);
    发出声音了
      

  8.   

    CBuild中的代码是:
    AnsiString asWaveFile = "C:\\Wave.wav";
    if (FileExists(asWaveFile ))
    {
      PlaySound(asWaveFile .c_str(), NULL, SND_ASYNC);
    }
    else
    {
      ShowMessage("The wave file doesn't exist.");
    }