Prevent app from closing

Hi!
We want the ability the prevent an app from being closed. Is there a way to lock an app? Or only allow it to only exit with a password? Maybe redirect the button's task?