Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!sun!amdcad!ames!ucbcad!zen!hoser.berkeley.edu!bryce From: bryce@hoser.berkeley.edu (Bryce Nesbitt) Newsgroups: comp.sys.amiga Subject: Re: MsgPorts, DOS, ACTION_SCREEN_MODE help needed Message-ID: <4471@zen.berkeley.edu> Date: Tue, 20-Oct-87 05:46:08 EDT Article-I.D.: zen.4471 Posted: Tue Oct 20 05:46:08 1987 Date-Received: Wed, 21-Oct-87 19:36:24 EDT Sender: news@zen.berkeley.edu Organization: Center Tapped Solids, Inc. Lines: 53 In article <378NU105451@NDSUVM1> NU105451@NDSUVM1.BITNET (Walter Reed) writes: >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... Here's a wish that Commodore would distribute AmigaMail free, in electronic form a few months after the paper version. >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. You were "oh soo close". The MsgPort of a CON: or RAW: window is stored in the fh_Type field of the FileHandle. You could have learned this by reading the libraries/dosextens.h include file. There are three general ways of finding a msgport to send packets to: 1. If it is CON: or RAW: Extract it from a filehandle. It's in the fh_Type field. Don't forget that file handles are, you guessed it, BPTRs! You need some wild and wooly code like: theport = (struct MsgPort *)( ((struct FileHandle *)(myhandle<<2))->fh_type ); 2. Use DeviceProc("XXX:"), use for devices such as DF0: or RAM:. Not valid for CON: or RAW: since each invocation of those gets a new handler and associated port.... "CON:" alone is not unique. 3. Look at pr_ConsoleTask. This will find the console handler for your CLI window, only if indeed you happen to have been run from the CLI. ACTION_SCREEN_MODE is 994L and takes a single argument, -1L for RAW: and 0L for CON:. You will normally send this to your process's pr_ConsoleTask, after verifying that you were started from a CLI. argc will be zero for programs started from the Workbench, or you can check the pr_CLI field in your Process structure. It will be zero for Workbench spawns. Don't use it in this case! You may also want to know about CSI ?7l and CSI ?7h. These turn on and off the auto-wrap at the end of lines. And CSI 20l and CSI 20h. These turn off and on LF to CR/LF translation. (use FindTask(0L) to get a pointer to your Process, use that to access pr_ConsoleTask and pr_CLI. Read all about the Process structure in the include file libraries/dosextens.h) |\ /| . Ack! (NAK, SOH, EOT) {o O} . bryce@hoser.berkeley.EDU -or- ucbvax!hoser!bryce (") The CBS nightly news: U Dan Rather, paraphrased: "Mr. Analyst, do you think we will continue to see a drop in the market like today's?" Market Analyst: "Well, that can only happen for three more days."