problem if use click at 'X' at the window form

how can i get the value after the user click at 'X' at the window form

when the user click at 'X' i want to pop up a message to remid the user they want to close the application or not

how can i get the value ???

thanx for helping