Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!cwjcc!tut.cis.ohio-state.edu!bloom-beacon!apple!parent From: parent@Apple.COM (Sean Parent) Newsgroups: comp.sys.mac.programmer Subject: Re: Closing Desk Accessories Summary: Closing a DA from in the DA Message-ID: <24067@apple.Apple.COM> Date: 16 Jan 89 19:29:08 GMT References: <2580008@hpausla.HP.COM> Organization: Apple Computer Inc., Cupertino, CA Lines: 19 In article <2580008@hpausla.HP.COM>, jcl@hpausla.HP.COM (Jeff Laing) writes: > What does a desk accessory have to do to close itself? > > If we assume I want a Close ... item on a desk accessories menu, then what > should that code do? Its not as simple as calling the 'DrvrClose' routine > in my code, nor is it 'CloseDeskAcc(myId)'.. > > Anyone got the answer? Are you having trouble with calling CloseDeskAcc? You would have to be carefull to make sure that after calling CloseDeskAcc your code did nothing that could disturb memory sinse you are now operating out in either unlocked or purgable code. If CloseDeskAcc is moving the code befor you return (run your code with Heap Scrample turned on in MacsBug to test things out) then you could try to chain to CloseDeskAcc. To do this call GetTrapAddress to get the address of CloseDeskAcc push your parameter and the ruturn address of the routine you are in and jump to CloseDeskAcc. I hope these ideas help. Sean