Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!pepe!shane From: shane@pepe.cc.umich.edu (Shane Looker) Newsgroups: comp.sys.mac.programmer Subject: Re: A suicidal desk accessory Message-ID: <538@mailrus.cc.umich.edu> Date: 17 Jun 88 22:24:58 GMT References: <326@uva.UUCP> <226000016@uxe.cso.uiuc.edu> Sender: usenet@mailrus.cc.umich.edu Reply-To: shane@pepe.cc.umich.edu (Shane Looker) Organization: University of Michigan Computing Center, Ann Arbor Lines: 34 In article <226000016@uxe.cso.uiuc.edu> leonardr@uxe.cso.uiuc.edu writes: ! !freek@uva.UUCP(Freek Wiedijk) writes in comp.sys.mac.programmer ! !>What is the proper way for my desk accessory to commit suicide, i.e. to close !>itself and vanish without leaving a trace? !>(i) To call my own Close routine won't help much, because the system won't !> know I'm doing it, and the DA will stay active. !>(ii) However if I call CloseDeskAcc from within the DA code, that code won't !> be there to return to, after CloseDeskAcc is finished (or will it?). !> ! Well, I don't know if it is the _CORRECT_ answer or not, but SigmaEdit (DA) !uses a CloseDeskAcc on itself when it gets a Cmd-Q ( Not menu item, yet ) and !things work just fine. Hope that helps... ! The line of code I use for this is: CloseDriver(dce->dCtlRefNum); dce is the Device Control Entry data structure. I do this if the DA can't open, Close is selected from the DA Menu, or a Goodbye Kiss is sent to the DA. No problems with this. (I think it is the correct way to do it.) !+ Leonard Rosenthol + fact, then again you might decide+ !+ President, LazerWare, inc. + that it really isn't, so you + (Strange, I saw you before I saw this, Leonard. I want my Usenet TV!) Shane Looker shane@pepe.cc.umich.edu uunet!umix!pepe.cc.umich.edu!shane Looker@um.cc.umich.edu