Isn’t it boring? All those big programs use sounds in Messageboxes, why not your’s? Take this litte routine to replace the old MessageDlg and listen!
It acts exact like MessageDlg, but with parameter atype it defines a systemsound and plays it with MessageBeep.
function MsgDlg (const msg: string; atype: TMsgDlgType;
abuttons: TMsgDlgButtons; helpctx: Longint): Word;
var mb: CARDINAL;
begin
case AType of
mtWarning: mb:= MB_ICONEXCLAMATION;
mtError: mb:= MB_ICONHAND;
mtInformation: mb:= MB_ICONASTERISK;
mtConfirmation: mb:= MB_ICONQUESTION;
else mb:= $0FFFFFFFF;
end;
MessageBeep (mb);
MsgDlg:= MessageDlg (msg, atype,
abuttons, helpctx);
end (*MsgDlg*);