MsgBox function

Personally I find both the WinAPI MessageBox and Application.MessageBox and MessageDlg functions cludgy and always add the following function to every app.

function MsgBox(const Msg: string;
  MsgType: Integer = MB_OK or MB_ICONSTOP): Integer;
  Result := MessageBox(Application.Handle, PChar(Msg),
    PChar(Application.Title), MsgType);

requires that Forms.pas is in the uses clause.


Share this article!

Follow us!

Find more helpful articles: