2009/4/22 Jan Dubois <j...@activestate.com>:
> On Wed, 22 Apr 2009, Rob May wrote:
>> I think I vote for it too, although I suspect that it'll cause some
>> (minor) layout problems for some people, as I'm not sure that all the
>> control decorations are the same on styled/non-styled controls.
>
> There are some layout differences, so it will be visible in some apps.

I've had a chance to play further, and at least on XP once the
perl.exe manifest required V6 of the common controls I can find no way
to get back to using the V5 controls in an extension.  Theoretically
is should be possible to build perl with ISOLATION_AWARE_ENABLED
defined, but then all extension DLL will use V5 of the common
controls, somewhat defeating the purpose of asking for them in
manifest in the first place.

I don't think this is a reason not to have the perl.exe manifest
request v6 common controls, but thought I should mention this as a
potential problem.

>> Last time I had some time to play (sadly I don't get much of that
>> these days) I was looking at adding a manifest to GUI.dll - it's
>> possible to add a manifest to a DLL and get the version 6 controls for
>> any windows created by that DLL, even if the main APP doesn't have a
>> manifest; however this depends on some stuff that's in the MS headers,
>> and doesn't work with the mingw headers (and hence won't work with
>> cygwin). I have a patch somewhere (but not with me at the moment).

The change required here is very simple.  Define the C Pre-processor
symbol ISOLATION_AWARE_ENABLED for the whole project, and add a v6
manifest to the resource section with resource id 2
(ISOLATION_AWARE_MANIFEST_ID);  build with Visual C and the
headers/system do eveything else for you.  As stated above this
doesn't work with mingw/gcc.

As I was getting fed up with adding/removing a manifest file from the
perl bin directory to test apps with and without manifests, I've
written a small module that can turn on visual styles
(Win32::VisualStyles).  Code can be download from
http://rob.themayfamily.me.uk/win32-gui/win32-visualstyles - I'd
appreciate feedback on the interface and whether it works for you.  If
I get positive feedback I'll finish tidying up the documentation and
release it as a CPAN module.  I've not put it in the Win32::GUI
namespace, as I think it has wider applicability.

The code creates a V6 activation context (what a manifest gets turned
into) and activates it.  It also provides access to the Win32 API
calls S/GetThemeAppProperties, IsThemeActive, IsAppThemed, and also
provides a control_styles_active() API (as the Win32 API calls don't
do exactly what their names suggest they might).

It should work back to perl 5.6, and should have no detrimental
effects on platforms that don't support styles (pre-XP);  If your perl
already has a V6 manifest it spots this and doesn't change the
activation context.

Comments, as always, welcome.

Regards,
Rob.


>
> Interesting.  I don't quite understand how this would work though, as
> the names of the controls are registered globally, so I don't see how
> you could mix old and new style controls inside a single process.
>
>> There are also some API calls that can be used to turn styling on and
>> off on a per-app and per-window basis, once you've got the v6 controls
>> loaded ..... I haven't yet come up with a suitable strategy for
>> introducing this thought; perhaps adding a v6 manifest to perl.exe
>> will force me to find time to investigate further?
>
> Could you find a link to some documentation about this so I can understand
> how this is supposed to work?
>
> Note that we'll also have to check with e.g. the wxPerl community, and
> probably others to hear what they think about this.
>
> Cheers,
> -Jan
>
>

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to