//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "MessageBox.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: MessageBox
// Method: Forms.TApplication.MessageBox
// Method: Forms.TApplication.NormalizeTopMosts
// Method: Forms.TApplication.RestoreTopMosts

// Warning: Is the MessageBox supposed to be on top of the objects in the form, or windows on the PC?
// Warning: Problem with MessageBox in Tiburon C++

// BeginCode
/*
The following code causes "stay on top" forms to allow a 
MessageBox to appear on top. After the message box is 
closed, the topmost forms are restored so that they continue
to float to the top.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Application->NormalizeTopMosts();
#ifdef _DELPHI_STRING_UNICODE
Application->MessageBox(L"This should be on top.", L"Look", MB_OKCANCEL);
#else
Application->MessageBox("This should be on top.", "Look", MB_OKCANCEL);
#endif
Application->RestoreTopMosts();
}
// EndCode
// EndExample: MessageBox
//---------------------------------------------------------------------------
