如题

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, MMSystem;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}
    {$R myres.res}procedure TForm1.Button1Click(Sender: TObject);
    begin
      PlaySound('RES000', HInstance, SND_RESOURCE or SND_MEMORY)
    end;end.
    以下是rc文件的内容  文件为myres.rc(请确保myres.rc bo.wav在同一目录中)
    --------
    RES000 WAVE bo.wav--------
    然后通过
    brcc32 myres.rc
    生成myres.res文件。