1 2 unit Unit1; 3 4 interface 5 6 uses 7 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 8 Dialogs, StdCtrls, mmsystem; 9 10 type 11 TForm1 = class(TForm) 12 Button1: TButton; 13 procedure Button1Click(Sender: TObject); 14 private 15 { Private declarations } 16 public 17 { Public declarations } 18 end; 19 20 var 21 Form1: TForm1; 22 23 implementation 24 25 {$R *.dfm} 26 procedure PlayWinSound(SoundKeyName: string); 27 begin 28 29 PlaySound(PChar(SoundKeyName), 0, SND_APPLICATION or SND_NODEFAULT or 30 SND_ASYNC or SND_NOWAIT); 31 end; 32 33 procedure TForm1.Button1Click(Sender: TObject); 34 begin 35 PlayWinSound('SystemStart'); 36 37 { Here is a list of some system sounds 38 SystemStart 39 SystemQuestion 40 SystemHand 41 SystemExclamation 42 SystemExit 43 } 44 end; 45 46 end.