Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!public!eeh From: eeh@public.BTR.COM (Eduardo E. Horvath eeh@btr.com) Newsgroups: comp.sys.amiga Subject: Re: How does SCRIPIT work? (How intercept IntuiMessages?) Message-ID: <378@public.BTR.COM> Date: 10 Sep 90 16:21:07 GMT References: <33651@cup.portal.com> <90252.202734UH2@psuvm.psu.edu> Organization: BTR Public Access UNIX, MtnView CA, Contact: cs@btr.com 415-966-1429 Lines: 56 In article <90252.202734UH2@psuvm.psu.edu> UH2@psuvm.psu.edu (Lee Sailer) writes: >In article <33651@cup.portal.com>, Lee_Robert_Willis@cup.portal.com says: >>I have a Amiga Guru question: I want to intercept the 'IntuiMessages' that >>are passed from Intuition to an application (where the "application" is >>any old pre-compiled Amiga program). [...] >I think your program could do a Forbid() to stop everything else from happening >and then walk through the systems list of windows until it finds the one you >want to manage. Assign its Message Port to one of your local variables, >and then run at a higher priority than the target task. Your task should >look through the incoming messages for ones it wants to delete, modify, or >add new ones, and then WaitPort(). This will give the target task time >to process some or all of the messages in the queue. If a new one arrives, >your task will awaken before the receiver gets a chance to get it. > >I think the IntuiMessage itself contains the MsgPort to ReplyMsg() to. >To intercept replies, your task would have to change that MsgPort to >one of its own. I guess it must also save a copy of the original MsgPort. >Then, it'll get the ReplyMsg()s, can do whatever it needs to do, and then >change its reply port back to the oringinal and reply to it. > >Like I say. I've never done this, but it seems like one possible way to >go at it. > > lee You also need to allocate a signal bit, put it in the message port mp_SigBits field, and change the mp_SigTask field to point to your task. Remember to save all of the information, because you should put it all back before you close down. You can wake up the original task through a Signal() call. Needless to say, this will not be compatible with any future protected memory environment. Yes, I have done this as a test, and it does work. But I don't recommend fiddling with other tasks' structures. ========================================================================= Eduardo Horvath eeh@btr.com ..!{decwrl,mips,fernwood}!btr!eeh "Trust me, I am cogisant of what I am doing." - Hammeroid ========================================================================= Newsgroups: comp.sys.amiga Subject: Re: How does SCRIPIT work? (How intercept IntuiMessages?) Summary: Expires: References: <33651@cup.portal.com> <90252.202734UH2@psuvm.psu.edu> Sender: Followup-To: Distribution: Organization: BTR Public Access UNIX, MtnView CA, Contact: cs@btr.com 415-966-1429 Keywords: