Using .NET 1.1, I need to be able to detect if Themes are enabled or
disabled, not for a specific application, but for the system as a whole (ie.
the current user). The reason I need to be able to do this is because of
this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to
build a component I am in turn making use of. So, I need to detect if
Themes are running and if so, see if the correct version of uxtheme.dll is
installed, else disallow a certain operation.
Any hints? 6 1956
I solved this using the code below, I hope it's more or less correct:
Dim myVersion As Version =
OSFeature.Feature.GetVersionPresent(OSFeature.Them es)
If not myVersion Is Nothing Then
Return True
Else
Return False
End If
"Fred Hedges" <do******@spammuch.com> escribió en el mensaje
news:e4*******************@news.demon.co.uk... Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to do this is because of this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to build a component I am in turn making use of. So, I need to detect if Themes are running and if so, see if the correct version of uxtheme.dll is installed, else disallow a certain operation.
Any hints?
Fred,
That is a good method.
Ken
-----------------
"Fred Hedges" wrote: I solved this using the code below, I hope it's more or less correct:
Dim myVersion As Version = OSFeature.Feature.GetVersionPresent(OSFeature.Them es)
If not myVersion Is Nothing Then
Return True
Else
Return False
End If
"Fred Hedges" <do******@spammuch.com> escribió en el mensaje news:e4*******************@news.demon.co.uk... Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to do this is because of this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to build a component I am in turn making use of. So, I need to detect if Themes are running and if so, see if the correct version of uxtheme.dll is installed, else disallow a certain operation.
Any hints?
Hi Fred,
You can use UxTheme's IsThemActive() API, available in Windows XP (NT 5.1)
and later.
<System.Runtime.InteropServices.DllImport("UxTheme ")> _
Public Shared Function IsThemeActive() as Boolean
End Function
After the P/Invoke function is defined in the appropriate scope, you can
call it provided that the Operating System's version is at least Windows XP:
Dim fThemesActive As Boolean = False
If Environment.OSVersion.Version >= New Version(5, 1) Then
fThemesActive = IsThemeActive()
End If
--
Stanimir Stoyanov www.stoyanoff.info
"Fred Hedges" wrote: Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to do this is because of this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to build a component I am in turn making use of. So, I need to detect if Themes are running and if so, see if the correct version of uxtheme.dll is installed, else disallow a certain operation.
Any hints?
To continue this conversation with myself, the above didn't work, because it
checks to see if the feature is present, not whether or not it is currently
switched on/off. I am still looking for a way to see if the user is using a
Theme (other than the stock "Classic Windows", which isn't really a Theme,
it's more the way things were before MS botched up it's themes
implementation).
"Fred Hedges" <do******@spammuch.com> escribió en el mensaje
news:e4*******************@news.demon.co.uk... I solved this using the code below, I hope it's more or less correct:
Dim myVersion As Version = OSFeature.Feature.GetVersionPresent(OSFeature.Them es)
If not myVersion Is Nothing Then
Return True
Else
Return False
End If
"Fred Hedges" <do******@spammuch.com> escribió en el mensaje news:e4*******************@news.demon.co.uk... Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to do this is because of this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to build a component I am in turn making use of. So, I need to detect if Themes are running and if so, see if the correct version of uxtheme.dll is installed, else disallow a certain operation.
Any hints?
Thats the one! Thanks.
Public Declare Auto Function IsThemeActive Lib "uxtheme.dll" () As Boolean
"Stanimir Stoyanov" <admin{at}stoyanoff{dot}info> escribió en el mensaje
news:27**********************************@microsof t.com... Hi Fred,
You can use UxTheme's IsThemActive() API, available in Windows XP (NT 5.1) and later.
<System.Runtime.InteropServices.DllImport("UxTheme ")> _ Public Shared Function IsThemeActive() as Boolean End Function
After the P/Invoke function is defined in the appropriate scope, you can call it provided that the Operating System's version is at least Windows XP:
Dim fThemesActive As Boolean = False If Environment.OSVersion.Version >= New Version(5, 1) Then fThemesActive = IsThemeActive() End If
-- Stanimir Stoyanov www.stoyanoff.info
"Fred Hedges" wrote:
Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to do this is because of this bug in MFC http://support.microsoft.com/?kbid=319740, which is used to build a component I am in turn making use of. So, I need to detect if Themes are running and if so, see if the correct version of uxtheme.dll is installed, else disallow a certain operation.
Any hints?
"Fred Hedges" <do******@spammuch.com> schrieb: Public Declare Auto Function IsThemeActive Lib "uxtheme.dll" () As Boolean
Remove the 'Auto' keyword.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Carl Mercier |
last post by:
Hi,
I'm trying to detect if XP themes are enabled or not in code. This not as
easy as it seams, however. I thought Application.VisualStyleState would be
of a lot of help, but unfortunately, it...
|
by: Agoston Bejo |
last post by:
Hi,
I searched around everywhere on the net, but could not find a simple example
of detecting if cookies are enabled - on server side, and without moving
from one page to another.
This should be...
|
by: NWx |
last post by:
Hi,
How can I detect is cookies are enabled or not in client browser?
Thanks?
|
by: Dean Slindee |
last post by:
Would like to use WindowsXP graphics themes (like shaded tab page in tab
control), but am using Windows 2000 operating system. Using Visual Studio
2005 and .Net Framwork 2.0. Have the option...
|
by: Clinton Farleigh |
last post by:
Hi,
I was going to ask a question, but I think I've answered it so now I am
going to rant about how crappy ASP.NET themes are instead.
As I've indicated above, my problem today is with themes....
|
by: Don |
last post by:
Can this be done?
I have theming enabled and have two themes for my web site (hence two
folders in the Themes).
But I need the styles to be applied whilst developing in the IDE.
I cannot see...
|
by: CK |
last post by:
Hello All,
I am trying to extend the default asp:ImageButton to include an image for an
enabled state and a second image for a disabled state. I currently did this
by extending the ImageButton...
|
by: stepterr |
last post by:
Hi All,
Does anyone know if it is possible to detect if a user has SSL enabled in their browser? I have a login page that is https but if the user does not have SSL enabled it of course just gives...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |