Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!leah!wfh58 From: wfh58@leah.Albany.Edu (William F. Hammond) Newsgroups: comp.sys.amiga Subject: Re: Finding address of active screen? Summary: You look at IntuitionBase->ActiveScreen Message-ID: <2644@leah.Albany.Edu> Date: 2 Mar 90 20:10:55 GMT References: <9003021936.AA21794@jade.berkeley.edu> Organization: Dept of Math & Stat, SUNYA, Albany, NY Lines: 48 In article <9003021936.AA21794@jade.berkeley.edu>, MCARTSHA@UREGINA1.BITNET (Shan Mcarthur) writes: > would I during the initialization of my program, go about finding an > address to the appropriate screen structure. I was thinking of having /* ints are long */ . . . struct NewWindow new; struct IntuitionBase *IntuitionBase; struct Screen *ascr; struct Window *wdw; . . . main() { . . . ULONG ilock = 0L; IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0); if(IntuitionBase==NULL) getout(20); /* Close anything already opened */ ilock = LockIBase((ULONG)0L); /* Don't dally with intuitionbase locked */ ascr = IntuitionBase->ActiveScreen; if(ascr==NULL) { UnlockIBase(ilock); getout(25); } /* Presumably you want to read screen characteristics before setting */ /* the parameters in your new window */ /* Otherwise, it's better to set the new window stuff before locking */ /* intuitionbase. */ new.LeftEdge = . . . new.TopEdge = . . . . . . new.Screen = ascr; . . . new.Type = CUSTOMSCREEN; wdw = (struct Window *)OpenWindow(&new); UnlockIBase(ilock); if(wdw==NULL) getout(22); rp = wdw->RPort; /* Now we're open for business */ . . . getout(0); } Good luck. -- Bill ---------------------------------------------------------------------- William F. Hammond Dept. of Mathematics & Statistics 518-442-4625 SUNYA, Albany, NY 12222 wfh58@leah.albany.edu wfh58@albnyvms.bitnet ----------------------------------------------------------------------