> No luck so far, I've tried everyones various suggestions. AFAIK, you
> can use hexadecimal or decimals for colours.

Three suggestions:

1) If you create a label the size of your window as the very first control,
you can use it's background color to fill the window. 
$Main->AddLabel
(
        -name => 'backcolor',
        -background => 0xFF0000,
        -pos => [0, 0],
        -size => [640, 480],
);
To avoid problems when resizing the window, you can also make the label the
size of the desktop (or larger). However, even then, Change()ing this
label's -background property has no effect.

2)
        local $dc = $Main->GetDC ();
        local $brush = new Win32::GUI::Brush
        (
                -style => 0,
                -color => 0x00FF00,     # there it is
        );
        local $oldbrush = $dc->SelectObject ($brush);
        $dc->Rectangle (0, 0, $Main->Width (), $Main->Height ());
        $dc->SelectObject ($oldbrush);  # only bother if you
                                                        # use DC otherwise
        $Main->InvalidateRect (0);
        $Main->Update ();
What's wrong with this method: whenever the window gets redrawn (like when
you change the size or activate it from behind another window) the color is
gone and needs to be redone with this procedure.

3) I did not do this, but maybe you'd have to resort to CreateWindowEx (with
API, not GUI). For an example you can look at alone.pl on
www.fairymails.com/perl/. That thing makes a label on the desktop, not a
colored window, but still you can see the use of CreateWindowEx.

hope one of these help you
Harald

Reply via email to