How would one go about controlling this form element? I would like to prompt the user before closing the application. Also, what about capturing ALT-F4?

Thanks,

Chris