puts(1,"This example requires, at least:\n")
puts(1,"win32lib version 0.50c .........\n")
-- and I haven't written the lesson text ;-)
without warning
include win32lib.ew
sleep(1)
free_console()
atom jk,ptr,ptr2,proghwnd,range,posx,posy,xdir,ydir
posx=100  posy=100  xdir=1  ydir=1
constant
CXFULL=w32Func(xGetSystemMetrics,{SM_CXSCREEN}),
CYFULL=w32Func(xGetSystemMetrics,{SM_CYSCREEN}),
Win1  = create(Window,"",0,0,0,CXFULL,CYFULL,{WS_POPUP,WS_DLGFRAME}),
Win2  = create(Window,"I'm busy !",Win1,100,100,200,125,WS_DLGFRAME),
PBar  = create(ProgressBar,"",Win2,5,10,183,15,0),
PBar2 = create(ProgressBar,"",Win2,5,35,123,20,0),
PBar3 = create(ProgressBar,"",Win2,5,65,163,25,0),
Timer = 1,
Timer2 = 2,
CX=CXFULL-200,
CY=CYFULL-125
setWindowBackColor(Win1,rgb(0,0,0))
openWindow(Win2,Modal)
jk = w32Func(xShowCursor,{False})
range=pack_word( 0, 200 )
jk=sendMessage(PBar,PBM_SETRANGE,0,range)
jk=sendMessage(PBar,PBM_SETSTEP,1,0)
jk=sendMessage(PBar2,PBM_SETSTEP,10,0)
jk=sendMessage(PBar3,PBM_SETSTEP,5,0)
procedure tick( integer timerId )
if timerId=1 then
 jk=sendMessage(PBar,PBM_STEPIT,0,0)
 jk=sendMessage(PBar2,PBM_STEPIT,0,0)
 jk=sendMessage(PBar3,PBM_STEPIT,0,0)
else
if posx < 1 or posx > CX then 
  xdir = -xdir 
end if
if posy < 1 or posy > CY then 
  ydir = -ydir 
end if
posx = posx + xdir
posy = posy - ydir
moveWindow(Win2,posx,posy,200,125,1 )
end if
end procedure
onTimer[Win2] = routine_id( "tick" )
setTimer( Win2, Timer, 250 )
setTimer( Win2, Timer2, 125 )
procedure stop(integer key,integer shift)
closeWindow(Win2)
closeWindow(Win1)
jk = w32Func(xShowCursor,{True})
end procedure
onKeyPress[Win2] = routine_id("stop")
WinMain( Win1, Maximize )

