Page 1 of 1

XP Skin Support only for EXEs and not DLLs?

Posted: Tue Jul 19, 2005 9:09 pm
by Straker
Hi All.

I have a DLL which utilizes a window to display a progressbar gadget, however on Windows XP it still shows the non-themed progressbar even though I have checked "Enable XP Skin support".

So my question is:

Does the "Enable XP Skin support" only work for EXEs and not DLLs which have themable gadgets?

Thanks
:?:

Posted: Sat Jul 23, 2005 8:56 pm
by Straker
Wow - did I stump everyone with this one, or do I need breath mints?

Posted: Sun Jul 24, 2005 1:56 pm
by GeoTrail
I always thought that if you open a window created from a dll then it gets the properties, such as manifest from the program which launches it, am I wrong there?

Posted: Fri Jul 29, 2005 4:14 pm
by Hydrate
I always assumed it got the properties from what launched it, with the programs that i use and have the xp theme so does my dll, where it doesnt, the same dll displays without themes...

Posted: Fri Jul 29, 2005 4:29 pm
by Gansta93
It is not just for xp skins, it is for all resources (Compiler options, Resources tab). Version informations are also ignored. Why ? Will that be changed?

Posted: Sat Sep 10, 2005 7:01 am
by ricardo
Gansta93 wrote:It is not just for xp skins, it is for all resources (Compiler options, Resources tab). Version informations are also ignored. Why ? Will that be changed?
Any workaround to have XP skin support on dll windows?

Posted: Sat Sep 10, 2005 8:23 am
by lexvictory
from microsoft's platform sdk documentation:
Using ComCtl32 Version 6 in an Application That Uses Extensions, Plug-ins, or a DLL That Is Brought into a Process
The following are examples of applications that use extensions.

Microsoft Management Console (MMC)
Windows Shell
Microsoft Visual Studio®
ComCtl32.dll version 6 is not completely backward compatible because some of the controls are modified and new controls are added. Using version 6 of the common controls might require code changes in your application. If an application uses extensions developed by a third party, you cannot change the extension if you have compatibility issues. The following steps describe how you can apply a visual style to your application without impacting an extension.

To create a manifest and enable your application to use visual styles.

Include the common controls header file as follows:
#include "commctrl.h"

Compile your application with the -DISOLATION_AWARE_ENABLED flag or insert the following statement before the #include "windows.h" statement.
#define ISOLATION_AWARE_ENABLED

Add a file called YourApp.manifest to your source tree that uses the XML manifest format.

Example:

<?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="CompanyName.ProductName.YourApplication"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Add the following statement to your application.
#define MANIFEST_RESOURCE_ID 2

Add the manifest to your application's resource file as follows:
MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"

//Winuser.rh includes the following defines:
//#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1

Using ComCtl32 Version 6 in Control Panel or a DLL That Is Run by RunDll32.exe
To create a manifest and enable your application to use visual styles.

Link to ComCtl32.lib and call InitCommonControls.
Add a file called YourApp.cpl.manifest to your source tree that has the XML manifest format.

Example:

<?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="CompanyName.ProductName.YourApplication"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Add the manifest to your application's resource file as resource ID 123.
Note When you author a Control Panel application, place it in the appropriate category. Control Panel now supports categorization of Control Panel applications. This means that Control Panel applications can be assigned identifiers and separated into task areas such as Add or Remove Programs, Appearance and Themes, or Date, Time, Language, and Regional Options.
Adding Visual Style Support to MMC Snap-ins
Support for visual styles may be added to more types of applications than the three previously described. For example, if you are writing a MMC snap-in you can add visual style support.

Compile your application with the -DISOLATION_AWARE_ENABLED flag or insert the following statement before the #include "windows.h" statement.
#define ISOLATION_AWARE_ENABLED

Include the common control header file in your snap-in source.
#include "commctrl.h"

Add a file called YourApp.manifest to your source tree that uses the XML manifest format.

Show Example

<?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="YourCompanyName.YourDivision.YourApplication"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Add the manifest to your application's resource file. See Using ComCtl32 Version 6 in an Application That Uses Extensions, Plug-ins, or a DLL That Is Brought into a Process for details on adding a manifest to a resource file.

btw manifests are the things that let ure app use xp styles
so maybe u have to put a manifest as resoucre id 2? or 123?