Marshal was designed to be implemented with one line of code and an entry in the implementation uses statement. Below is a code sample showing the changes with conditional compile statements to only show in a debug build. More options are covered in Marshal Implementation Options
implementation {$R *.dfm} uses {$IFDEF DEBUG} Vcl.SERTTK.Marshal, {$ENDIF} ; procedure TfrmRTTKVCL.btnMarshalClick(Sender: TObject); begin {$IFDEF DEBUG} TSERTTKMarshalAPI.ShowMarshal; {$ENDIF} end;
TSERTTKMarshalAPI unit name changed in version 2023.03.28, It is now VCL.SERTTK.Marshal
TSERTTKWorker.ShowMarshal was deprecated in release 2022.09.25 replace with TSERTTKMarshalAPI.ShowMarshal
This approach ensures that Marshal will never go into a release build. The button "btnMarshal" will still be on the form, an assignment to visible = false would hide the button. The calling method could be a hot key combination, image click, any event that you can catch.
ShowMarshal is an API method either creates or shows Marshal if it already exists. Details about passing options are in Marshal Implementation Options