1 2 //--------------------------------------------------------------------------- 3 4 #include <vcl.h> 5 #include <mmsystem.h> 6 #pragma hdrstop 7 8 #include "Unit1.h" 9 //--------------------------------------------------------------------------- 10 #pragma package(smart_init) 11 #pragma resource "*.dfm" 12 TForm1 *Form1; 13 //--------------------------------------------------------------------------- 14 __fastcall TForm1::TForm1(TComponent* Owner) 15 : TForm(Owner) 16 { 17 } 18 //--------------------------------------------------------------------------- 19 void PlayWinSound(AnsiString Sound) 20 { 21 PlaySound(Sound.c_str(), 0, SND_APPLICATION || SND_NODEFAULT 22 || SND_ASYNC || SND_NOWAIT); 23 } 24 void __fastcall TForm1::Button1Click(TObject *Sender) 25 { 26 PlayWinSound("SystemStart"); 27 28 /* Here is a list of some system sounds 29 SystemStart 30 SystemQuestion 31 SystemHand 32 SystemExclamation 33 SystemExit 34 */ 35 } 36 //--------------------------------------------------------------------------- 37