473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Visual Styles

I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #1
5 4759
Hi,

As far as I know the visual stules are enabled for the whole application (or
at least per UI thread) you can't have some of the controls with enabled
visual styles and the other part not.

However I found that enabling visual stules from .NET cause problems some
times. It seems to work OK if the visual styles are enabled not form .NET
code, but by using manifest file.

Here you can find informarmation how to enable visual stules using manifest
files

http://msdn.microsoft.com/library/de...ndowsForms.asp

--

Stoitcho Goutsev (100)

<ML****@hotmail.com> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #2
You can call SetWindowTheme() (Interop call from uxtheme.dll) to disable
Visual Styles for a specific control. Pass String.Empty to the 2 string
Arguments to disable Visual Styles and null to re-enable.

[DllImport("uxtheme.dll")]
private static extern IntPtr SetWindowTheme(IntPtr hWnd, String
pszSubAppName, String pszSubIdList);

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<ML****@hotmail.com> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
I want to use visual styles in my app, but it is causing a problem with
a DLL I use. Is there a way to disable visual styles for that DLL? I do
not have access to the code for the DLL. The DLL's developer is aware
of the problem but will not have a fix ready in time for me.

Jun 12 '06 #3
Thanks, Mick. I have tried SetWindowTheme. It does change the
appearance of the dialogs/controls created by the DLL, but the problem
persists. I think I need the visual styles disabled when the dialog is
created.

Any other ideas?

Jun 12 '06 #4
Without knowing anything about the dll or the problems you're encountering,
not really.

Have you tried placing a DoEvents() call after EnableVisualStyles() ?
Have you tried using a Manifest file instead of calling EnableVisualStyles()
?

Are you using VS2002, VS2003 or VS2005?

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<ML****@hotmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Thanks, Mick. I have tried SetWindowTheme. It does change the
appearance of the dialogs/controls created by the DLL, but the problem
persists. I think I need the visual styles disabled when the dialog is
created.

Any other ideas?

Jun 13 '06 #5
Thanks for the response.

The one part of the DLL that does not work is a color selection
control. It uses colored buttons that appear raised when selected. The
control will not let the user select a new color when visual styles are
used.

I am using DoEvents() and I have tried using a manifest instead of
EnableVisualStyles. I am using VS2005.

Could something like ActivationContext or AppDomain be used to control
the environment of a DLL? I am not real familiar with them.

Thanks,
Mike

Jun 13 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ht990332 | last post by:
I'm writing applications in vc++ .net 2003. How do I give the applications visual styles on winxp without adding a ..manifest file?
0
by: Anand | last post by:
Hi, I have done a sample windows application with controls looks resembling to Windows XP Visual Styles by using the guidelines http://msdn.microsoft.com/library/default.asp? url=/library/en-...
2
by: Alvo von Cossel I | last post by:
hi, i have an app with a lot of stuff including an optios form. 1 of the options is disabling the xp visual styles. i know how to enable them but not how to disable them. has anyone got an...
10
by: Robert Jacobson | last post by:
Hi, I'm develing a COM add-in for Microsoft Word XP that displays a form. I'd like to have the form display using the Windows XP theme. However, neither using a manifest nor calling...
3
by: Brian Henry | last post by:
here's something odd, maybe someone can explain it, when i turn on application.enablevisualstyles at application start before i do my application.run(context) command in the sub main, when the app...
1
by: sklett | last post by:
Hi, I'm not SURE if Visual Styles is what I'm delaing with, but there is my situation. On computer A which I have chosen "Classic Windows" as my "Theme" my application appears the way I want it...
3
by: nkarnold | last post by:
My application seems to be ignoring Enable XP visual styles, which is ticked on in the application properties. the Toolbar and Menubar, which appear the nice looking shaded blue appear like that...
2
by: Flash | last post by:
Hello, recently I was looking through the system properties and came accross system.visualstyles namespace. This appears to contain all of the visual style elements in xp and I was wondering if it...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
On my old workstation (development workstation) if I set Application/Enable XP visual styles - I was able to get/see the visual styles - like button borders highlighting when you run the mouse over...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.