Alt+F4 key event is (on most OSs I guess) processed by the OS before it'S even sent to the browser, so cancelling the event inside the browser won't help a thing - even if it was Javascript that is executed inside the browser's UI, not only the current document.
Therefore - what you're trying to do cannot be done.
so please refer my previous reply if you dont want to show message write return false instead of return "your message" i.e
http://www.aspforums.net/Threads/970279/How-to-disable-ALTF4/Replies/1#Replies