Bug 45918 - eclipse should enable XP visual styles if available (from comctl32.dll)
Summary: eclipse should enable XP visual styles if available (from comctl32.dll)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-02 06:38 EST by leon breedt CLA
Modified: 2008-09-09 09:45 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description leon breedt CLA 2003-11-02 06:38:51 EST
in order to appear a completely native windows XP application, Eclipse should
indicate that it desires version 6.0 of comctl32.dll if it is available.

this is apparently done with an "application manifest" file, i'm not sure how
well this maps, if at all, to the way the SWT dll works. 

the main noticeable difference if this is implemented would be the style of the
standard push-buttons. (currently they still look very much like windows 2000
controls on XP).
Comment 1 leon breedt CLA 2003-11-02 06:40:04 EST
this is discussed in somewhat more depth here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/cookbook.asp
Comment 2 Steve Northover CLA 2003-11-03 15:30:40 EST
Unfortunately, it is javaw.exe that needs to include the manifest.  In order 
to enable the XP theme you need to put the file javaw.exe.manifest in the same 
directory as javaw.exe.

Chrix to verify what I just said and either link this PR to another PR that 
captures the same issue or close as WONTFIX.
Comment 3 leon breedt CLA 2003-11-06 00:23:16 EST
i can confirm this. i copied the following file to $JAVA_HOME/bin as
javaw.exe.manifest, and i magically got windows XP styles for all UI elements.

this is good enough for me :)


--snip---

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
	<assemblyIdentity
		version="1.0.0.0"
		processorArchitecture="X86"
		name="SWT.javaw"
		type="win32"/>
	<description>Standard Widget Toolkit</description>
	<dependency>
		<dependentAssembly>
			<assemblyIdentity
				type="win32"
				name="Microsoft.Windows.Common-Controls"
				version="6.0.0.0" processorArchitecture="X86"
				publicKeyToken="6595b64144ccf1df"
				language="*"/>
		</dependentAssembly>
	</dependency>
</assembly>
Comment 4 Gunnar Wagenknecht CLA 2004-02-11 00:41:17 EST
In bug 37997 there cam up the request to 'update look to the most recent native 
look'. Should this be covered into this bug report or do we need a new one?
Comment 5 Eric Bodden CLA 2004-02-13 17:10:48 EST
Strange, does not work for me... is the one manifest file enough? See yourself..
.

C:\Documents and Settings\Eric>cat %JAVAHOME%\bin\javaw.exe.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" 
name="SWT.javaw" type="win32"/>
        <description>Standard Widget Toolkit</description>
        <dependency>
                <dependentAssembly>
                        <assemblyIdentity type="win32" name="Microsoft.Windows.
Common-Controls" version="6.0.0.0" processorArchitecture="X86" 
publicKeyToken="6595b64144ccf1df" language="*"/>
                </dependentAssembly>
        </dependency>
</assembly>
Comment 6 Christophe Cornu CLA 2004-02-13 18:16:05 EST
Eric,
the manifest file must be copied to the jre/bin that is actually picked up by 
Eclipse. It sounds like that in your case Eclipse is not using the jre in %
JAVA_HOME%/bin
Comment 7 Christophe Cornu CLA 2004-03-05 14:37:42 EST

*** This bug has been marked as a duplicate of 53859 ***
Comment 8 Archimedes Trajano CLA 2004-08-02 14:21:03 EDT
I can't seem to get this working with JDK 1.5 beta 3
Comment 9 Steve Northover CLA 2006-04-06 14:54:33 EDT
Reopened because the manifest file is no longer needed.
Comment 10 Steve Northover CLA 2006-04-06 14:55:47 EDT
Fixed > 20060406
Comment 11 Gunnar Wagenknecht CLA 2006-04-06 14:56:58 EDT
(In reply to comment #9)
> Reopened because the manifest file is no longer needed.

cool
Comment 12 Andrée Proulx CLA 2006-04-06 16:18:15 EDT
Steve:
Kim is asking: Should we assume that "comctl32.dll" must come with the OS?
Comment 13 Steve Northover CLA 2006-04-06 16:40:28 EDT
What?  Yes, comctl32.dll has been in Windows as far back as 3.11.  There is nothing anyone has to do.
Comment 14 Florian Priester CLA 2006-04-06 17:10:05 EDT
> Reopened because the manifest file is no longer needed.
> Fixed > 20060406

Can this be true? This is great news! Amazing.
Comment 15 Steve Northover CLA 2006-04-06 17:30:36 EDT
Yes, it's true.  Nobody is happier than me.
Comment 16 Benjamin Pasero CLA 2006-04-07 04:33:49 EDT
Awesome :-)
Comment 17 Sebastian Machhausen CLA 2006-04-14 12:24:59 EDT
A never-ending story has finally come to its end. Thank you guys for fixing this issue.
Comment 18 Genady Beryozkin CLA 2006-04-17 19:33:55 EDT
I think that it makes the toolbar look bad and occupy a lot of space.

See http://www.eclipsezone.com/servlet/JiveServlet/download/18110-69466-92011370-4515/xp-style.png

Should it be logged as a separate issue (or is there a bug for it already)?
Comment 19 Genady Beryozkin CLA 2006-04-17 19:51:13 EDT
never mind, found bug 99984.
Comment 20 Jaakko Lindvall CLA 2006-04-18 09:07:10 EDT
(In reply to comment #9)
> Reopened because the manifest file is no longer needed.
> 

What resulted in this? Change in XP, Sun VM or something else? I'm curious (and very happy this is fixed now, of course).
Comment 21 Thorsten Spaeth CLA 2006-06-28 05:54:01 EDT
(In reply to comment #9)
> Reopened because the manifest file is no longer needed.
> 

Does this only work with "real" RCP Applications or also doing it in standard SWT.
I'm trying to deploy a webstart application with the XP LAF, but until now (currently I'm deploying the 3.224 DLLs) I was not successful.
Comment 22 Steve Northover CLA 2006-06-28 11:07:39 EDT
It should just work in SWT.  Download a nightly and try it.  If this fails for you, does a simple hello world program with only a single push button inside fail?  Post a screen shot of the failure.
Comment 23 Thorsten Spaeth CLA 2006-06-29 05:48:30 EDT
(In reply to comment #22)
> It should just work in SWT.  Download a nightly and try it.  If this fails for
> you, does a simple hello world program with only a single push button inside
> fail?  Post a screen shot of the failure.
> 

Thanks!

I can confirm that with the nightly snapshot I've tested it with - all Styles work as expected or more or less like the user has chosen to work in! (I've tested against eclipse-RCP-N20060627-0010-win32.zip) 

I've also deployed it via Webstart and it worked. Users with 2000 LAF on XP had the 2000 Button-Styles and users with XP Standard Style had their LAF. Also the buttons showed up with combined text + images in a seperate demo program.

 
Comment 24 Gili Mising name CLA 2008-09-08 20:53:54 EDT
I'm curious, how did you fix this without using a manifest file?
Comment 25 Steve Northover CLA 2008-09-09 09:45:23 EDT
We used activation contexts and embeded the manifest file in the DLL.  See OS.Java for the code.