function OnWindowCloseQuery(WindowName: String): Boolean;
var
S: String;
begin
// Occurs when the user wants to close the window.
// Note: set to False if you do not want to close the window.
S := InputBox("To exit, please enter the password", "Security", "");
Result := S = "OurPassword"; // replace OurPassword by what you want. Do not remove quotes.
end;