🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #30889

Re: Closing desk accessories

#30889
From: Dan Wilga at UMASS Amherst
Date: Fri, 26 Feb 1988 16:17
44 lines
2699 bytes
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<AES_handle; i++ ) {   /* assume the DAs have lower handles */
    buff[2] = 2+i;                  /* an educated guess */
    appl_write( i, 16, buff );      /* the message is read the next time the */
  }                                 /* DA does evnt_mesag() or evnt_multi() */

I am just wondering two things: first, is it safe to assume that any DAs will
have AES handles less than the current application? Second, assuming a DA
actually does care what menu id (as stored in buff[2]) the DA is assigned to
would my little guess be correct? Granted, there really is no reason I can
see why a DA should care if the menu id passed matches what it sees as being
correct, but considering how few correctly written DAs there are out there,
who knows.

Now for my opinion on the Copyright issue....naw, just kidding.

                                       Dan Wilga
-----------------------------------------------------------------------------
"You may think it's a long way down        Gribnif@UMASS.Bitnet
 the road to the chemist, but that's       Gribnif%UMASS.forsythe.stanford.EDU
 just peanuts to space."                        (methinks)
     -- Hitchhikers
Technical Details
Message-ID: <880226111414E67.BCMH@Mars.UCC.UMass.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!UMass.BITNET!Gribnif

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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