I would like to call some actions when I click on close button like terminate another process or run a specific database query.