Path: utzoo!mnetor!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: Closing desk accessories Message-ID: <988@atari.UUCP> Date: 23 Feb 88 18:57:28 GMT References: <8802210020416D5.BLBS@Mars.UCC.UMass.EDU> Organization: Atari Corp., Sunnyvale CA Lines: 36 in article <8802210020416D5.BLBS@Mars.UCC.UMass.EDU>, Gribnif@umass (Dan Wilga at UMASS Amherst) says: > > Greetings! > > Is there some way to actually "tell" desk accessories that are currectly > opened within an application to close? I am writing a program that uses > Pexec() to call other programs, but the problem I am running into is that > any DA's that occupy windows and are left open when my program executes > another do not receive the AC_CLOSE message and so do not know they should > be closed. Of course, I cannot simply close their windows for them; that > only messes them up. Pterm() somehow does this for itself since it > automagically sends the correct message when the application terminates. > shel_write() also seems to suffer from this same problem. Is there any > good solution, short of hacking-into the OS? I think you hit on the solution without knowing it: closing their windows doesn't pay, but you can SEND THEM the AC_CLOSE message (I think). Check the message library for "send a process a message" and check the application library for "get ap_id for an accessory" (I don't really know that much AES). Then send the accessory the close message. Sending it wind_close is usually enough, since (like the Control Panel) clicking "close" in the window usually shuts down the accessory as well. Failing that, you could try the opposite of app_init -- I forget its name -- because I think it's that call which closes accessories, not Pterm(). Pterm() doesn't know a thing about accessories, or AES, or anything at that level. So try app_deinit before the Pexec and app_init after it. (Remember that your window handles might be different after the new init... They probably won't be, but write your code as though they might be.) Like I said, I don't know much about AES -- don't take this as Gospel. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt