Another one of those things I've forgotten, so easy points! :)
I have an exit button on my form. Click it and the following code is executed.
If MessageDlg('Do You Really Want To Exit?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
However, I want it to work on the window close 'X' gadget too, but when I put the code in OnClose or OnCloseQuery when I say yes to exit it doesn't until I've clicked three times and if I say No, it exits straight away.