Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between Application.MessageBox, Windows.MessageBox and Dialogs.MessageDlg in Delphi

In Delphi; what are the differences between Application.MessageBox, Windows.MessageBox or Dialogs.MessageDlg? Or which is more efficient to use computer memory?

like image 560
SimaWB Avatar asked Mar 27 '09 11:03

SimaWB


1 Answers

Windows.MessageBox is the WinAPI MessageBox, Application.MessageBox is a wrapper around it. Dialogs.MessageDlg however is a VCL form. So if you are concerned about memory or thread safety, the first two might be better suited. MessageDlg OTOH is more flexible and easier to use (IMHO, of course).

Nowadays, I'd consider task dialogs (TaskDialogIndirect, TTaskDialog or another wrapper).

like image 103
Uli Gerhardt Avatar answered Sep 30 '22 17:09

Uli Gerhardt