It is sometimes the case that you may accidentally press Ctrl-z while in Emacs and the Emacs Window magically disappears. Ctrl-z is by default bound to iconify-frame which is another way of saying minimize the window. To make this feature more pleasant, introduce a yes or no confirmation when Ctrl-z is pressed. Add the following code to your .emacs file.
(if (yes-or-no-p (format "Are you sure you want to iconify/deiconify Emacs? "))
(global-set-key [?\C-z] 'smart-iconify-or-deiconify-frame)