Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!think!ames!ucbcad!ucbvax!VIOLET.BERKELEY.EDU!mwm From: mwm@VIOLET.BERKELEY.EDU (Mike Meyer, My watch has windows) Newsgroups: comp.sys.amiga Subject: Re: How much of the console.device do I need to close? Message-ID: <8706012228.AA20376@violet.berkeley.edu> Date: Mon, 1-Jun-87 18:28:19 EDT Article-I.D.: violet.8706012228.AA20376 Posted: Mon Jun 1 18:28:19 1987 Date-Received: Wed, 3-Jun-87 02:27:31 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 59 The continueing saga of the quest for the re-openable console window. In our last episode, Carolyn Scheppner had suggested: >> Haven't done it myself but my guess is that your failure to Remove the >> initial request is causing the problems. I suggest trying the same code >> used for aborting and removing an asynchronous printer request: This was done. In fact, the code tried was: Close a window (but leave console open): if (!CheckIO(consoleReadMsg)) AbortIO(consoleReadMsg); WaitIO(consoleReadMsg) ; CloseDevice(consoleWriteMsg); if (consoleReadMsg) DeleteStdIO(consoleReadMsg); if (consoleWriteMsg) DeleteStdIO(consoleWriteMsg); And to open a window: if ((consoleWriteMsg = CreateStdIO(consoleWritePort)) == NULL) cleanup(TRUE); if ((consoleReadMsg = CreateStdIO(consoleReadPort)) == NULL) cleanup(TRUE); if (OpenConsole(consoleWriteMsg,consoleReadMsg,EmW) != 0) cleanup(TRUE); consoleMsgBit = consoleReadPort->mp_SigBit; QueueRead(consoleReadMsg,&letter); This has the exact same problems mentioned before: the last character typed before the window open/close shows up in the input queue. The code to input characters is from the RKM, and is basically the same as in Rob Peck's book: if (wakeupmask & CONSOLE_MESSAGE) { /* keyboard */ GetMsg(consoleReadPort); qchar(letter); QueueRead(consoleReadMsg, &letter); charfound = TRUE; } where qchar puts the character in an internal queue. I think the problem is that some bogus message (other than input ready) is generated by the window StdIO open/close, and shows up on consoleReadPort. However, I can't find documentation as to what should be check on the Msg coming from the port. Anyone got any ideas? Thanx,