Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!x1g2000prh.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I disable the Windows Close Button in a GUI?
Date: Fri, 26 Jun 2009 14:39:07 -0700 (PDT)
Organization: http://groups.google.com
Lines: 26
Message-ID: <7cde863a-b0ea-4eed-885e-11adf6e3117f@x1g2000prh.googlegroups.com>
References: <h23eu6$fqs$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.34
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1246052347 6667 127.0.0.1 (26 Jun 2009 21:39:07 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 26 Jun 2009 21:39:07 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: x1g2000prh.googlegroups.com; posting-host=198.206.219.34; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) 
	Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 wwwproxy-son-ca-02.ca.sandia.gov:80 (squid/2.5.STABLE14)
Bytes: 2285
Xref: news.mathworks.com comp.soft-sys.matlab:551007


On Jun 26, 2:35 pm, "William" <w_kin...@yahoo.com> wrote:
> 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
Check here:
http://www.mathworks.co.kr/matlabcentral/newsreader/view_thread/165498
For the close request function, just set that window's visibility to
off.

Hope this works for you.
-Nathan