> One more thing - maybe important. This background color problem is not
> neccesary connected with a memory. I think that maybe the bigger problem is
> that it rises the GDI object counter. Please compare difference between Perl8
> and Perl10 - in Perl 5.8 in principle the memory is stable whereas in Perl10
> it blows up.

The memory issue you are seeing in 5.10 is a perl bug (my understanding). When GDI handles aren't released they can use a significant amount of memory . 

> Jeremy, how you manage the beckground problem? May you scatch it?

I'm not sure the approach I use would help you as I draw the whole screen (fonts, graphics, backgrounds etc). I've looked at this again, and I think I've fixed the bug within Win32::GUI. You mentioned that you built Win32::GUI from scratch, so if you replace the DestroyWindow method in GUI.xs (around line 2231) with the code below it should fix things for you...

    ###########################################################################
    # (@)INTERNAL:DestroyWindow()
BOOL
DestroyWindow(...)
CODE:
    HWND handle;
    LPPERLWIN32GUI_USERDATA perlud;
    handle = (HWND) handle_From(NOTXSCALL ST(0));
    perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLong(handle, GWL_USERDATA);
    if(ValidUserData(perlud) ) {
      //free any resources...need to check other things like fonts etc
      if (perlud->hBackgroundBrush != NULL) {
        DeleteObject((HGDIOBJ) perlud->hBackgroundBrush);
        perlud->hBackgroundBrush = NULL;
      }
    }
    RETVAL = DestroyWindow(handle);
OUTPUT:
    RETVAL