473,804 Members | 3,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine color scheme used by app

I want to determine the Windows color scheme that is being used by my app.
This means that I need to determine the following:

1. Does the OS support themes?
2. Are themes currently enabled within the OS?
3. Are themes currently enabled within the application?
4. If all of the above are true, then what color scheme is being used (e.g.,
Default (blue), Olive Green or Silver if the OS is Windows XP)?

Also, I have not used Windows Vista so any help with the possible color
schemes with that OS would be greatly appreciated.

Thanks for any help!
Lance

Oct 2 '07 #1
8 2481
"ljlevend2" <lj*******@nosp am.nospamschrie b
I want to determine the Windows color scheme that is being used by
my app. This means that I need to determine the following:

1. Does the OS support themes?

System.Windows. Forms.VisualSty les.VisualStyle Information.IsS upportedByOS
2. Are themes currently enabled within the OS?
System.Windows. Forms.VisualSty les.VisualStyle Information.IsE nabledByUser
3. Are themes currently enabled within the application?
System.Windows. Forms.Applicati on.VisualStyleS tate
4. If all of the above are true, then what color scheme is being used
(e.g.,
Default (blue), Olive Green or Silver if the OS is Windows XP)?
System.Windows. Forms.VisualSty les.VisualStyle Information.Col orScheme

Also, I have not used Windows Vista so any help with the possible color
schemes with that OS would be greatly appreciated.
Can't help you with that.
Armin

Oct 2 '07 #2
Wow, thank you both so much for the info. That was quick and a lot easier
than I expected.

Just one more question ... is there an event (or some other notification)
when the value of
System.Windows. Forms.VisualSty les.VisualStyle Information.Col orScheme changes?
Of course I could just test the value during a timer's tick event, but I
wanted to see if there is a more efficient technique. I need to know when
VisualStyleInfo rmation.ColorSc heme changes so that I update my custom drawn
controls if the user changes the Windows Color Scheme while my app is running.

Thanks again!
Lance

Oct 3 '07 #3
"ljlevend2" <lj*******@nosp am.nospamschrie b
Wow, thank you both so much for the info. That was quick and a lot
easier than I expected.

Just one more question ... is there an event (or some other
notification) when the value of
System.Windows. Forms.VisualSty les.VisualStyle Information.Col orScheme
changes? Of course I could just test the value during a timer's tick
event, but I wanted to see if there is a more efficient technique.
I need to know when VisualStyleInfo rmation.ColorSc heme changes so
that I update my custom drawn controls if the user changes the
Windows Color Scheme while my app is running.

Thanks again!
Lance
Untested:
Subscribe to Microsoft.Win32 .SystemEvents.U serPreferenceCh anged. In the
handler check

If e.Category = Microsoft.Win32 .UserPreference Category.Visual Style

Armin

Oct 3 '07 #4
Hello Lance,

Armin's suggestion is right. UserPreferenceC hanged event is able to capture
the change of system Theme. I did a test for it:

SystemEvents.Us erPreferenceCha nged += new
UserPreferenceC hangedEventHand ler(SystemEvent s_UserPreferenc eChanged);

void SystemEvents_Us erPreferenceCha nged(object sender,
UserPreferenceC hangedEventArgs e)
{
if (e.Category == UserPreferenceC ategory.VisualS tyle)
{
MessageBox.Show ("Changed");
}
}

Then when I change my system's theme from Windows Vista to Windows Classic,
the message box "Changed" is shown.

Thank you, Armin.

Lance, if you have any other concen or need anything else, please feel free
to let us know.

Sincerely,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=============== =============== =============== ====
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 4 '07 #5
ljlevend2 schreef:
Wow, thank you both so much for the info. That was quick and a lot easier
than I expected.

Just one more question ... is there an event (or some other notification)
when the value of
System.Windows. Forms.VisualSty les.VisualStyle Information.Col orScheme changes?
Of course I could just test the value during a timer's tick event, but I
wanted to see if there is a more efficient technique. I need to know when
VisualStyleInfo rmation.ColorSc heme changes so that I update my custom drawn
controls if the user changes the Windows Color Scheme while my app is running.

Thanks again!
Lance
What if the scheme is changed to another theme that the user downloaded?
--
Rinze van Huizen
C-Services Holland b.v
Oct 4 '07 #6
"Jialiang Ge [MSFT]" <ji****@online. microsoft.comsc hrieb
>
Thank you, Armin.
Was a pleasure. :)
Armin
Oct 4 '07 #7
Hello Rinze,

I did a test on it. The event SystemEvents.Us erPreferenceCha nged is still
able to capture the change of theme.

Sincerely,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=============== =============== =============== ====
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 5 '07 #8
Hi Lance,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=============== =============== =============== ====
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 9 '07 #9

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

Similar topics

9
2761
by: Lenard Lindstrom | last post by:
I was wondering if anyone has suggested having Python determine a method's kind from its first parameter. 'self' is a de facto reserved word; 'cls' is a good indicator of a class method ( __new__ is a special case ). The closest to this I could find was the 2002-12-04 posting 'metaclasses and static methods' by Michele Simionato. The posting's example metaclass uses the method's name. I present my own example of automatic method kind...
17
6157
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number. "Decimal Number" sometimes serves to distinguish Base 10 numbers, eg "15", from Base 2 numbers, Eg "1111". At other times "Decimal Number" serves to differentiate a number from an integer. For the rest of this post I shall only use either...
0
1330
by: Philippe Poulard | last post by:
I don't know if anybody already designed an URN scheme for XML; here is a proposal: I call it the "XML URN Scheme", or XUS. ========= URNs are logical names used to identify resources. XUS defines an URN Scheme for XML documents that works on a delegation model. As XUS (XML URN Scheme) is used exclusively for XML documents, it uses namespace URIs to identify this scheme and the delegate scheme.
31
3749
by: bilbothebagginsbab5 AT freenet DOT de | last post by:
Hello, hello. So. I've read what I could find on google(groups) for this, also the faq of comp.lang.c. But still I do not understand why there is not standard method to "(...) query the malloc package to find out how big an allocated block is". ( Question 7.27) Is there somwhere explained why - because it would seem to me, that free()
36
2488
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other applications. In the end all I want to do is form1.backcolor = system.whatever.color
2
1723
by: Johannes | last post by:
When you do a webrequest like: Dim objWebRequest As WebRequest = WebRequest.Create(objURI) the returned class can be httpwebrequest, ftpwebrequest or any othe descendant webrequest type that is registered on the system. How can I determine which type is returned. I tried if (objWebRequest is System.Net.HttpWebRequest) then ..... But the system says I am not allowed to use types in expressions. --
10
3043
by: Pep | last post by:
I have a problem I need to solve which looks like memory exhaustion. Is there a function that I can use in c++ to determine the size of the heap before and after a allocation? The C++ code is running on linux and freeBSD. The actual library I am interfacing with uses malloc and i have no control over it so I need to see the state of the heap after each use of the libraries allocation functions.
4
2644
by: Chris Davies | last post by:
I'm curious. I'd like to determine whether a particular URI scheme (the "ftp:", "news:", "http:" part) is available within the user's browser. For example, consider this HTML snippet: Telephone us on <a href="tel:+44113393xxxx">0113 393-xxxx</a> I could extend the tag with an onClick handler that displayed an alert() box (or similar), but ideally I'd like it only to do that if the underlying URI scheme couldn't be handled by the...
11
2914
by: gnuist006 | last post by:
Is there a Delphi equivalent in the C world or Scheme/LISP world ? Recently, Delphi is in resurgence. In Russia people are using like crazy. For example, Bolega has written a free image processing program scankromsator in delphi because its easy to write a gui. In arabia people are using it also. Also delphi, I heard delphi allows visual programming and delphi programs run on:
0
9708
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.