VBDOS Basic DOS using Timer in Windows DOS box 
Author Message
 VBDOS Basic DOS using Timer in Windows DOS box

Help please!

I have an application that was written to run under dos in
Quickbasic/Visual Basic.
This app also needs to run in under windows.  It works fine if it is run
full screen, or
in the foreground.  If it is run in the background, then it doesn't work
properly.

The program uses the Timer and is illustrated below:

''''''''''''''''''''''''''''''''''''''''''
CLS
SysTime# = NOW
SysTime2# = NOW
CONST TimeDifference = 1
ON TIMER(1) GOSUB times
TIMER ON

DO
LOOP UNTIL INKEY$ <> ""
END

times:
SysTime2# = SysTime#
SysTime# = NOW

LOCATE , 1: PRINT FORMAT$(SysTime#, "dd-mm-yyyy hh:mm:ss"),
FORMAT$(SysTime2#, "dd-mm-yyyy hh:mm:ss"); " Elapsed Time = ";
FORMAT$(SysTime2# - SysTime#, "hh:mm:ss")

RETURN

''''''''''''''''''''''''''''''''''''''''''

If the app is run in the foreground, it runs at a higher priority and
correctly displays
the time every second.  If it is run in the background, it runs at a lower
priority.  It
recieves fewer timer clicks, and consequently, timer functions and sleep do
not work as
they should - they run more slowly.  This app when run in the background
displays the
time about every 9 seconds under windows 95 and every 16 seconds under
windows 3.11.

What I want to do is what the Microsoft utility MSD.exe does when you start
it.  If it is in
a window it switches to full screen before running.  I presume it is
calling some function
under windows to do this but I cannot find how it is done.

Alternatively I need to boost the priority of the background task.

The solution has to work under Windows 3.11, 95, NT 3.51, NT 4.00.

Any help would be greatly appreciated!

Thanks

Stephen Roberts



Tue, 19 Dec 2000 03:00:00 GMT  
 VBDOS Basic DOS using Timer in Windows DOS box

I have come across this problem also -

the timer dilation problem I just tolerate by not using any critical
timings .... just delay type operations.

Another setting to look at is the properties of the
shortcut or menu option for starting the program
in question - drag the 'Idle Sensitivity Setting' on
Misc tab all the way to 'Low' - you can also set the Full
Screen option on the Usage Section of the Screen Tab
to set the screen up in Full Screen as per MSD.

hope this helps.

Shane.



Quote:
> Help please!

> I have an application that was written to run under dos in
> Quickbasic/Visual Basic.
> This app also needs to run in under windows.  It works fine if it is run
> full screen, or
> in the foreground.  If it is run in the background, then it doesn't work
> properly.

> The program uses the Timer and is illustrated below:
<snip><>>

> Thanks

> Stephen Roberts




Tue, 19 Dec 2000 03:00:00 GMT  
 VBDOS Basic DOS using Timer in Windows DOS box

When you run the application, windows creates a .pif file.  Use this
file to launch the program.  In the .pif, tell windows to NOT let the
app sleep when in the background (it should be called idle sensitivity
or something like that).  Also, you can set the default window size when
the app loads (this is how MSD does it).

        By the way, if you need a windows based time application, I can provide
it.

--

Thomas Cameron

http://w3.to/thomasacc/
http://members.xoom.com/accweb/

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
          Every new beginning comes from
            some other beginning's end.
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=



Tue, 19 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VBDOS Basic DOS using Timer in Windows DOS box

2. DOS or Windows DOS-box?

3. Bis : DOS/Basic in Windows Box : particularities ?

4. DOS/Basic in Windows Box : particularities ?

5. Looking for Visual Basic for DOS (VBDOS) ?

6. Visual BASIC DOS VBDOS

7. Looking for Visual Basic for DOS (VBDOS) ?

8. NetBios/Dos Windows/Dos EXE properties

9. Free Beta Visual Basic Dos Compiler (DOS, WIN95/NT,Linux)

10. basic-dos or c-dos

11. Running a MS-DOS programm in a DOS-BOX

12. Timer control and DOS Box

 

 
Powered by phpBB® Forum Software