Xref: utzoo alt.msdos.programmer:1327 comp.sys.ibm.pc.programmer:212 Path: utzoo!attcan!telly!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Newsgroups: alt.msdos.programmer,comp.sys.ibm.pc.programmer Subject: Re: idling in the interpreter Message-ID: <1990Mar2.165200.28296@druid.uucp> Date: 2 Mar 90 16:52:00 GMT References: Reply-To: darcy@druid.UUCP (D'Arcy J.M. Cain) Organization: D'Arcy Cain Consulting, West Hill, Ontario Lines: 39 In article pas@lcs.mit.edu (Paul A. Selkirk) writes: > >Does anyone know of a bulletproof way for a TSR to tell whether DOS (assume >2.x or 3.x) is idling in the command interpreter, or executing a program? > >I have determined, through much pain and disassembly, that DOS uses service >0A (buffered string input) to get the next command, but other programs use that >as well. I can get by on this knowledge, but I would prefer something a little >more certain. > >For the record, I am writing a screen-saver TSR that will only trigger when DOS >is idling. There are dozens of screen-savers, but I need one that won't kill >a lengthy graphics program. (Ever try generating the Mandelbrot set on a 4.77 >MHz XT with no FPU? I thought so.) > >Any leads will be duly appreciated. > > paul How about a way of turning screen saver on and off instead. You can have an interupt which turns screen saver on and off then write a utility which calls the interupt which you can run before your program. You can also have a keyboard hook to turn it on and off asynchronous to the system state. In cases where you have access to source code you can turn off the saver within a program just for the parts where this is important. I'd suggest something like the following AH = 0 Turns off screen saver AH = 1 Turns on screen saver AH = FF Returns 1234H or something unique to determine presence. I would have it also return the current active state so that programs could restore the system when necessary. -- D'Arcy J.M. Cain (darcy@druid) | Thank goodness we don't get all D'Arcy Cain Consulting | the government we pay for. West Hill, Ontario, Canada | (416) 281-6094 |