Board index » delphi » Turbo Pascal / Win 95 API

Turbo Pascal / Win 95 API

We are experiencing a problem using programs compiled with Pascal 7.0
for DOS running under Windows '95.  We install large hotel property
management systems that consist of several programs running
simultaneously on Windows '95 based servers and workstations.

Several of the programs run in 'background', that is to say they are
constantly monitoring data from telephone systems, movie systems, etc.
These programs never require any user intervenion, and therefore never
receive any keyboard input.

Windows '95 multitasking situation puts these programs to 'sleep' if
there is no keyboard input.  The only adjustment that can be made is an
idle sensitivity setting.  Microsoft has no answers for us either.

Is there a command that can be issued from within the Pascal code that
will tell the windows API not to put these programs asleep?

Any input on this matter would be greatly appreciated.

Sincerely,

Lee Patterson
lrpat...@worldnet.att.net

 

Re:Turbo Pascal / Win 95 API


On Wed, 09 Oct 1996 13:15:26 -0600, Lee Patterson

Quote
<lrpat...@worldnet.att.net> wrote:
>We are experiencing a problem using programs compiled with Pascal 7.0
>for DOS running under Windows '95.  We install large hotel property
>management systems that consist of several programs running
>simultaneously on Windows '95 based servers and workstations.

>Several of the programs run in 'background', that is to say they are
>constantly monitoring data from telephone systems, movie systems, etc.
>These programs never require any user intervenion, and therefore never
>receive any keyboard input.

>Windows '95 multitasking situation puts these programs to 'sleep' if
>there is no keyboard input.  The only adjustment that can be made is an
>idle sensitivity setting.  Microsoft has no answers for us either.

>Is there a command that can be issued from within the Pascal code that
>will tell the windows API not to put these programs asleep?

>Any input on this matter would be greatly appreciated.

>Sincerely,

>Lee Patterson
>lrpat...@worldnet.att.net

An unconventional solution...

Any other idea is probably better than this one....

It's not the proper way to do it, but have you thought about
simulating keyboard input? Simply tell the keyboard ring-buffer that a
key was pressed every now and then. I'm not sure it will work, but it
will be a very easy way to do it. Connect this routine to the timer
interrupt and you're done.

Peter

Re:Turbo Pascal / Win 95 API


Lee Patterson <lrpat...@worldnet.att.net> wrote in article
<325BF9CE.3...@worldnet.att.net>...

Quote
> We are experiencing a problem using programs compiled with Pascal 7.0
> for DOS running under Windows '95.

> Windows '95 multitasking situation puts these programs to 'sleep' if
> there is no keyboard input.

What do you mean by 'sleep'? There is a check-box on the Misc page of the
properties dialogue that determines whether the process is suspended if it
becomes
a Background process. If this box is unchecked then the process WILL run,
albeit
slowly...

However, since this box is directly above the Idle-Sensitivity control, I
suspect that
you have done this. If this is insufficient then you might have to consider
porting
your DOS code to Windows...

Chris.

Re:Turbo Pascal / Win 95 API


On 10 Oct 1996, Chris Rankin wrote:

Quote
> > We are experiencing a problem using programs compiled with Pascal 7.0
> > for DOS running under Windows '95.

> > Windows '95 multitasking situation puts these programs to 'sleep' if
> > there is no keyboard input.

> What do you mean by 'sleep'? There is a check-box on the Misc page of the
> properties dialogue that determines whether the process is suspended if it
> becomes
> a Background process. If this box is unchecked then the process WILL run,
> albeit
> slowly...

> However, since this box is directly above the Idle-Sensitivity control, I
> suspect that
> you have done this. If this is insufficient then you might have to consider
> porting
> your DOS code to Windows...

Procedure WinSlice; Assembler;
Asm
   mov   AX, $1680
   int   $2F
End;

You should determine that Windoze is loaded first.  It can be used like
this:

   Repeat
      WinSlice;
   Until Keypressed;

Again, I am doing a bad thing in assuming Windoze is running.  With little
effort you can make a procedural hook which will release the slices for
Win, OS/2, DV, Netware, whatever..  WinSlice does pretty well at giving up
the timeslices in OS/2, but I think there may be better ways.  Opinions
are welcome, as are alternate timeslicing routines.  I will at some point
post a PD unit that will handle the above mentioned taskers.

           \|/           Peace can not exist without war, nor can war
       \\\\/|\////          exist without peace. Think about it...
        \\\\|////             ----------------------------------
            V                 KnightBird - knght...@teleport.com

Re:Turbo Pascal / Win 95 API


KnightBird <knght...@teleport.com> wrote in article
<Pine.SUN.3.92.961011031026.17512T-100...@linda.teleport.com>...

Quote
> Procedure WinSlice; Assembler;
> Asm
>    mov   AX, $1680
>    int   $2F
> End;

I don't think that this will help; the way I understand it, this call is
for Win 3.1 (not Windows 95) and forces DOS apps / boxes to surrender time
slices for other Win 3.1
processes - and even Windows itself! - to run in. However Windows 95 uses a
pre-
emptive multi-tasking approach, meaning that the *OS* decides how much time
each
app gets. The problem that the original poster is experiencing is (I think)
that each
DOS app is completely frozen out until it receives keyboard focus.

Chris.

Other Threads