Path: news.mathworks.com!not-for-mail
From: "William" <w_king10@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: How do I disable the Windows Close Button in a GUI?
Date: Fri, 26 Jun 2009 21:35:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <h23eu6$fqs$1@fred.mathworks.com>
Reply-To: "William" <w_king10@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246052102 16220 172.30.248.38 (26 Jun 2009 21:35:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 26 Jun 2009 21:35:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 930703
Xref: news.mathworks.com comp.soft-sys.matlab:551006


I have a GUI that uses three separate windows; a main window and two auxiliary windows.  When the aux windows are not being used, they are still open, but set to invisible.  I am trying to make it impossible for the user to close the window using the Windows red "X" Close button in the top right of the Window.  If the user clicks on the Close button the window can never be opened again as data is lost.  I would like to either:

1)  Disable the Close button to force the user to press a Close button I have created which just makes the window invisible, or

2)  Program the close button to make the window invisible directly.

Is there a way to disable or modify the properties of the Windows Close button?

Thank you,
Billy