The fix to my problem, is to always have a loop running. then I can always put it on the taskbar and bring it back.
The following code does the trick:
require "scancodes"
win = openwindow ("Start",-1,-1,1200,700)
setactivewindow (win)
backcolor (0,0,0,255)
repeat
cls()
key = getkey()
t1 = timerticks()
-- x,y,radius
color (255,0,250,255)
circle(500,350,300)
a = 0 ; x = 250 ; y = 200
while( a < 100200)
do
dot(x,y)
a = a + 1
x = x + 1
if x > 750 then
y = y + 1 ; x = 250
end
end
t2 = timerticks()
t3 = t2-t1
color (255,255,0,255)
textsize (2)
drawtext ("Press Escape to exit ..",0,0)
drawtext ( t3,0,20)
sync()
--key=inkey()
until key == SCANCODE_ESCAPE
closewindow(win)
closeapplication()