I am using the code below to create a messagebox in Delphi 7. However I also have another form on screen who's FormStyle
is set to fsStayOnTop
and the messagebox appears behind this form.
Is there any way to force the messagebox to appear in front?
if Application.MessageBox('Amessage here','Title', +MB_APPLMODAL + MB_ICONQUESTION + MB_YESNO) = IDNO then
Application.MessageBox
. Instead use WinAPIMessageBox
function and pass it aHWND
of your topmost form. Additionally, you can useMB_TASKMODAL
flag to make sure the dialog will popup on top of every other form. – Little