Path: utzoo!attcan!uunet!pmafire!uudell!milano!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: comp.sys.amiga Subject: Re: Question on System Request Message-ID: <6934@jhunix.HCF.JHU.EDU> Date: 20 Nov 90 15:23:17 GMT References: <1990Nov19.151458.7631@diku.dk> <7997@ucdavis.ucdavis.edu> Distribution: comp Organization: The Johns Hopkins University - HCF Lines: 53 >In article <1990Nov19.151458.7631@diku.dk> aggaton@diku.dk (Klavs Torben Pedersen) writes: >>How the f*&^$ can I make this Bl*&^% requester to pop up on MY >>window????? In article <7997@ucdavis.ucdavis.edu> zerkle@iris.ucdavis.edu (Dan Zerkle) writes: >System requester are invoked by the operating system; your program has >no control over these. >In other words, you're screwed. I think that Klavs is asking how to REDIRECT requestors to HIS screen, rather than having them pop up on a different screen (notably the Workbench screen). This is easy to do. Find the appropriate pointer, save the old value, and repoint it at YOUR window. When your program exits, restore the old value. To disable requestors completely, give the pointer the value -1. struct Process *proc; APTR oldWindowPointer; DisableRequestors(&proc, &oldWindowPointer); ...do stuff... EnableRequestors(proc, oldWindowPointer); /* Turn off system requestors for this process. */ void DisableRequestors(struct Process **proc, APTR *oldWindowPtr) { *proc = (struct Process *)FindTask(NULL); (* find process *) *oldWindowPtr = (*proc)->pr_WindowPtr; (* save old pointer*) (*proc)->pr_WindowPtr = (APTR)(-1L); (* turn off req's *) } /* In the above function, you could send requestors to YOUR window * instead with: * * (*proc)->pr_WindowPtr = (APTR)myWindow; */ /* Turn on system requestors for this process, after they have been * turned off by DisableRequestors(), above. */ void EnableRequestors(struct Process *proc, APTR oldWindowPtr) { proc->pr_WindowPtr = oldWindowPtr; } Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////