function onFileExit
% closes main window.
global hMainWindow;
close(hMainWindow);
