Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!UMass.BITNET!Gribnif From: Gribnif@UMass.BITNET (Dan Wilga at UMASS Amherst) Newsgroups: comp.sys.atari.st Subject: Re: Closing desk accessories Message-ID: <880226111414E67.BCMH@Mars.UCC.UMass.EDU> Date: 26 Feb 88 16:17:42 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 44 Greetings! In my previous letter I was looking for a way to close desk accessories before using Pexec() to call a second GEM application from within a program. Well, I have found something that seems to work (after finally discovering some docs that actually explain the way appl_write() REALLY works). The following code segment seems to do the trick. int buff[8], w_hand, i, AES_handle, dum; AES_handle = appl_init(); /* get the handle of my application */ . . /* the guts */ . /* close any windows still open */ wind_get( 0, WF_TOP, &w_hand, &dum, &dum, &dum ); /* topmost window */ while( w_hand > 0 ) { /* until no more windows */ wind_close( w_hand ); wind_delete( w_hand ); /* now the next one down is top */ wind_get( 0, WF_TOP, &w_hand, &dum, &dum, &dum ); /* get the next one */ } buff[0] = AC_CLOSE; /* emulate the message normally received */ buff[1] = AES_handle; /* handle of app. that caused the close */ for( i=0; i