> -----Original Message-----
> From: Jeremy White [mailto:jez_white@...]
> Sent: Tuesday, December 23, 2003 3:59 PM
> To: jonathan.southwick@...;
> Subject: Re: [perl-win32-gui-users] Progress bar's [coloring]
> >From: Jonathan Southwick <jonathan.southwick@...>
> >I have been wanting to do this forever myself but never was=20
> able to ...=20
> >until today!!!
> >I figured out a way to do it and its rather simple. You need to use=20
> >SendMessage though but it works.
> >Here is the answer:
> >$result =3D SendMessage($hWndControl, PBM_SETBARCOLOR, 0, $color);
> Nice work. This may be a little cheeky but could you turn=20
> this into a method=20
> (SetColor?) so it could be added to the next build of=20
> win32::gui? Might as=20
> well try and get all these enhancements into the core as they=20
> are solved.
I would have to agree. Can this be added to the next Dev Branch of the =
app as both compile time properties and also as methods?
Johan, is there any way these can also be added as properties to TGL? =
Depending on how long it will be before the next release will come out, =
you may want to do it yourself if the code, or wait for the whole thing =
in the next version of Win32::GUI and call the native functions.
My hope now that we have several very committed users to developing =
this, we will see releases at least once a month or so...
In the meantime, what I do is something like this:
my ($window) =3D shift;
#my $desk =3D $window->GetDesktopWindow();
#my(undef, undef, $d_width, $d_height)=3D =
my ($win_width)=3D $window->ScaleWidth();
my ($win_height) =3D $window->ScaleHeight();
my $delta_w =3D ($d_width /2) - ($win_width/ 2);
my $delta_h =3D ($d_height / 2) - ($win_height / 2);
my $Window =3D new Win32::GUI::Window (
#set everything here. I left out for brevity...
so that I can have a single method for doing centered window placement. =
You could just as easily have other methods which do things simular and =
be called as native object methods. Of course, this is not a complete =
working example, but it gives you the idea. I do not know if this is a =
"good" practice, but it works. If someone would like to translate this =
into a proper Win32::GUI method, I would expect this would be more =
efficient in xs with a perl method calling the xs function.