1. Out of breath
- Posted by r.stowasser at web.de
Feb 19, 2003
Hello list,
the following little program works quite nice, but somehow I am loosing
my gdi and system resources in Win95 and Win98 (probably in Win Me too)
when running it. I am using Euphoria v 2.3 and win32lib 57.9 with some
changes I found in the mailing list.
Using Window´s resource monitor (Rsrcmtr.exe) I can see visually how my
little pc gets out of breath after starting the show. Am I doing
something wrong? After exiting the program the resources are (almost)
released again. I suppose I need some more statement anywhere in the code?
Kind regards
Roland Stowasser
include Win32lib.ew
without warning
integer ticks ticks = 0
constant PushButton2 = createEx( PushButton, "Exit", Window1, 8, 12, 88,
28, 0, 0 )
constant PushButton4 = createEx( PushButton, "Start", Window1, 8, 48,
88, 28, 0, 0 )
constant PushButton6 = createEx( PushButton, "Stop", Window1, 8, 84, 88,
28, 0, 0 )
procedure Polygon()
integer z
sequence size, points
integer height, width
z = rand(20)+12
size = getClientRect(Window1)
height = size[4]-size[2]
width = size[3]-size[1]
-- define array
points = repeat({0,0}, z)
-- fill array
for a = 1 to z do
points[a][1] = rand(width) --x coordinate
points[a][2] = rand(height) --y coordinate
end for
setPenColor( Window1, rand(255*255*255))
drawPolygon( Window1, True, points)
end procedure
end procedure
setHandler( Window1, w32HPaint, routine_id("Window1_onPaint"))
Polygon()
end procedure
setHandler( Window1, w32HResize, routine_id("Window1_onResize"))
repaintWindow(Window1)
Polygon()
end procedure
setHandler( Window1, w32HTimer, routine_id("Window1_onTimer"))
setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))
setHandler( PushButton6, w32HClick, routine_id("PushButton6_onClick"))
WinMain( Window1,Normal )