Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!psuvax1!vu-vlsi!cbmvax!higgin From: higgin@cbmvax.UUCP (Paul Higginbottom SALES) Newsgroups: comp.sys.amiga Subject: Re: MsgPorts, DOS, ACTION_SCREEN_MODE help needed Message-ID: <2552@cbmvax.UUCP> Date: Tue, 20-Oct-87 14:50:39 EDT Article-I.D.: cbmvax.2552 Posted: Tue Oct 20 14:50:39 1987 Date-Received: Thu, 22-Oct-87 03:07:00 EDT References: <378NU105451@NDSUVM1> Organization: Commodore Technology, West Chester, PA Lines: 47 in article <378NU105451@NDSUVM1>, NU105451@NDSUVM1.BITNET (Walter Reed) says: > I am working on a version of MicroEmacs that would support either opening > a new window or useing the current window and setting its mode to RAW. > My problem is that I don't know how to get a processes message port. > I have the original RKM's (1985 edition) and they offer no help to this > particular subject. I did locate in the dos tech ref manual the structures > on file handles (which i find out from Input() & Output()) and can find > the processID but I can't find ANY info on how to find a msgport when you > know the file handle. > Can anyone offer any help on the subject? > Thanks, > Walter Reed It's real ugly. First of all pointers to file handle structures are not what they seem. They're BCPL'ised so you'll have to monkey with it to access the real fields. Plus, the fields defined in the DOS include file don't seem to match the documentation, and I think it's the fh_Type field that is in fact the Process ID in the handle. So you need to do: struct FileHandle *realfh; struct Process *proc; /* will the real file handle please stand forward */ realfh = (struct FileHandle *)((ULONG)fh << 2); proc = realfh->fh_Type; This may have mistakes ... I don't have my source handy. Manx 3.4a by the way, has set_raw() or something like it which does the whole job. Secondly, you don't need to get process id's from the Input() returned filehandle, just use your own... i.e: extern struct Task *FindTask(); struct Process *me; me = (struct Process *)FindTask(NULL); dos_packet(me->pr_ConsoleTask, ACTION_SCREEN_MODE, -1L); Or something similar. Paul. Disclaimer: the above could be complete baloney.