473,621 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I get the text color for the taskbar clock?

With XP's default theme (Windows XP style / Default (blue) on the Display
Properties/Appearance tab), the taskbar clock foreground color is white.
Change that to Windows XP style / Olive Green, and that taskbar clock
foreground changes to black.

So my question is, how do I get that color programmaticall y?

Thanks!
Nov 16 '05 #1
5 5264
Hi,

Do you have any information that this color is at all stored anywhere? I
just think the system might check whether the taskbar background is light or
dark and choose the appropriate clock foreground color.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Quoner" <ne**@quone.com > wrote in message
news:7a******** *********@newss vr21.news.prodi gy.com...
With XP's default theme (Windows XP style / Default (blue) on the Display
Properties/Appearance tab), the taskbar clock foreground color is white.
Change that to Windows XP style / Olive Green, and that taskbar clock
foreground changes to black.

So my question is, how do I get that color programmaticall y?

Thanks!


Nov 16 '05 #2
Hmm....that's an interesting point. But then, how does one determine the
taskbar background color?

Thanks.

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote
in message news:Oa******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

Do you have any information that this color is at all stored anywhere? I
just think the system might check whether the taskbar background is light
or dark and choose the appropriate clock foreground color.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Quoner" <ne**@quone.com > wrote in message
news:7a******** *********@newss vr21.news.prodi gy.com...
With XP's default theme (Windows XP style / Default (blue) on the Display
Properties/Appearance tab), the taskbar clock foreground color is white.
Change that to Windows XP style / Olive Green, and that taskbar clock
foreground changes to black.

So my question is, how do I get that color programmaticall y?

Thanks!

Nov 16 '05 #3
So my question is, how do I get that color programmaticall y?


I think you can use OpenThemeData(" Clock") followed by
GetThemeColor(C LP_TIME, TMT_TEXTCOLOR). The taskbar clock itself
simply uses The DrawThemeText API. If Visual Styles are disables, you
can fall back on the button text color.
http://msdn.microsoft.com/library/en...nthemedata.asp
http://msdn.microsoft.com/library/en...themecolor.asp

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #4
Thanks for the reply.

Sorry to be such a newbie, but these are the calls I'm now trying:

HTHEME hTheme = OpenThemeData(H WND_DESKTOP, L"Clock");
GetThemeColor(h Theme, CLP_TIME, CLS_NORMAL, TMT_TEXTCOLOR, &color);

But that first call returns NULL for the hTheme. The same call works for,
say, L"Button", but not for L"Clock". Is that first parameter, HWND_DESKTOP,
incorrect, and if so, what is the correct parameter?

Thanks again.

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:OI******** ******@TK2MSFTN GP14.phx.gbl...
So my question is, how do I get that color programmaticall y?


I think you can use OpenThemeData(" Clock") followed by
GetThemeColor(C LP_TIME, TMT_TEXTCOLOR). The taskbar clock itself
simply uses The DrawThemeText API. If Visual Styles are disables, you
can fall back on the button text color.
http://msdn.microsoft.com/library/en...nthemedata.asp
http://msdn.microsoft.com/library/en...themecolor.asp

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #5
Is that first parameter, HWND_DESKTOP,
incorrect, and if so, what is the correct parameter?


Don't you have your own window handle you can pass in? HWND_DESKTOP is
a pseudo handle for use with the MapWindowPoints function.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #6

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

Similar topics

5
2842
by: Art | last post by:
Hi, I'm using a form text input to display a JavaScript clock. It has no other purpose than that, just show the date and time. What I would like to do now is prevent anything else happening when it's moused over. I was able to remove the cursor using the blur() method, something like this: document.formname.inputname.blur();
2
2130
by: vooose | last post by:
Does anyone know how to put a textbox in the windows tray or taskbar (a la google desktop search) There is plenty of info on how to make your app. appear as an icon in there but not adding custom controls to that area. -- Wal http://www.vooose.com
1
1357
by: oktave | last post by:
Hi, Every form showed on the Windows also show in the task bar while it's showontaskbar property set to true. And the text show on the taskbar is the same as the form's text property. Can I set the taskbar's text of a form differ from it's text property? Is it possible?
2
1507
by: Backwards | last post by:
Hi everyone. I'm using visual studio 2005 and programming with VB. Is there anyway to have your application hide to the taskbar by the clock. The likes of the way norton anti virus auto proctect and outlook hides there with just there icons showing. Anybody know how to do this? Regards,
2
6536
by: mistral | last post by:
I want place custom text rotating around analogue clock. Here is javascript that is clise to my task: http://javascript.internet.com/time-date/mousetrailclock.html But it have a few unnecessary features which is difficult to alter. i want: 1. replace week/year/days in external circle with my custom text: 'My custom text'
0
1107
Ali Rizwan
by: Ali Rizwan | last post by:
Hi I want to make sliding text to my title bar of my application and also want to slide text on my taskbar. Plz Help me
6
2307
lotus18
by: lotus18 | last post by:
Hello World I have an API here that shows and hides the windows taskbar. My question is ... how can I completely hide the taskbar without a space below? Like setting it to Auto-hide the taskbar on the taskbar properties? When I run this program it seems like the taskbar's opacity=0 or invisible but still it has a little space below. Do you get what I mean? I want to show how is it really looks like but I don't know how to insert an image...
0
2568
by: archcommus | last post by:
Hey all, First post on thescripts, this site has answered many of my questions in the past via searching. Basically, my philosophy on the taskbar and notification area is that what's displayed shouldn't necessarily represent what is running, but what is running that requires interaction. Some things simply require no interaction and so shouldn't be displayed. My anti-virus program and Windows Sidebar are two apps for me which require no...
10
2501
by: Mark Rae [MVP] | last post by:
Hi, This is really just a theoretical question for my own interest, and not for any nefarious purpose... :-) Say we have three applications running - Notepad, Wordpad and Excel - and each window is in its "normal" state i.e. not maximised, and not minimised to the taskbar. We click each of the three taskbar buttons in turn and, of course, the three
0
8597
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...
0
7127
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
6101
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
5554
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();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
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
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1460
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.