> Probably I am mixing something. I wrote another variant of the script: 
> test.pl:
> ##########################################
> #!/usr/bin/perl -w
> use strict;
> use warnings;
> use Win32::GUI qw();
> my $i = 0;

Ok:) as soon as I saw your code, I can see the problem...

The problem is: 

-background=>0xff00ff

Comment out those lines and you'll have no memory or GDI leak...

checkout this bug report on sourceforge:

http://sourceforge.net/tracker/?func=detail&aid=2864551&group_id=16572&atid=116572

A while back I did try and fix this bug as I had the same problem, but didn't find a quick fix (it's in XS/C not perl). If possible, could you add your example to this bug report as someone might fix it for the next release of Win32::GUI (several people have been hit by this bug, and in your case it's fatal).

As a work around, I draw the text/background manually - which worked well in my case (as text fields/labels wasn't the right design approach). Not sure if that could work for you...

Cheers,

Jeremy.