MessageDlg with sound  

Send By: Yeradis Barbosa
Web : N.A.
Email: yeradis@msn.com
Date: 26/02/03

Tip accessed 519 times

 







 procedure TForm1.Button1Click(Sender: TObject);

   function MessageDlgSound(const Msg: string;
      DlgType: TMsgDlgType;
      Buttons: TMsgDlgButtons;
      HelpCtx: Longint): Word;
   const
       Sounds: array [TMsgDlgType] of integer = (
       MB_ICONEXCLAMATION, MB_ICONHAND, MB_OK, MB_ICONQUESTION, MB_ICONASTERISK);
   begin
     MessageBeep(Sounds[DlgType]);
     Result := MessageDlg(Msg,DlgType,Buttons,HelpCtx);
   end;

 begin
   {Ejemplo de llamada / call example}
   MessageDlgSound ( 'Un Ejemplo / A Example',
                      mtInformation,
                     [mbOk],0);
 end;



It works like MessageDlg but... with sound.