But user can touch on the button on Main Window again even though the top window displayed is 'Screen A'.
please see the section Take a closer look at the Dialog functionality, and especially the following paragraph which seems to describe your application case:
This feature permits the user to switch in the superior component between dialogs presented in it. To prevent it, use one of the following techniques:
Option 1: Place the button within a separate component and present the component as dialog (e.g. as Screen Main). Then when new dialog (e.g. Screen A) is presented, the Screen Main is automatically suppressed from being able to react to user inputs.
Option 2: Make the presented dialog (e.g. Screen A) explicitly modal (see also Modal GUI components). This will suppressed all other components from being able to react to user inputs. To achieve this, invoke BeginModal() just after invoking PresentDialog(), for example:
var Application::Alert alert = new Application::Alert;
alert.OnButton1 = onClose;
// Present the dialog
GetRoot().PresentDialog( alert, null, null, null, null, null, null, null, null, false );
// ... and make it modal
GetRoot().BeginModal( alert );
Later when the dialog is about to be dismissed, end its modal state. For example:
var Core::Group dialog = ...
// End modal state of the dialog
GetRoot().EndModal( dialog );
// ... and dismiss it
GetRoot().DismissDialog( dialog, null, null, null, null, null, false );
I hope it helps you further.