Discussion:
Cannot open theme data for Tray Notification area?
(too old to reply)
dc2000
2007-05-28 06:15:01 UTC
Permalink
Hi everyone:


I seem to be stuck with a simplest thing. I need to open an XP theme for
TRAYNOTIFY area (i.e. tray notification area where the clock is displayed),
but I seem to always get NULL in return.

Here's the code:

HTHEME hTheme = OpenThemeData(NULL, L"TrayNotify");
if(!hTheme)
{
//Error - I seem to get here, why?
}

The code above works with all general classes, except that one. What am I
doing wrong???
Grzegorz Wróbel
2007-05-29 15:43:33 UTC
Permalink
Post by dc2000
I seem to be stuck with a simplest thing. I need to open an XP theme for
TRAYNOTIFY area (i.e. tray notification area where the clock is displayed),
but I seem to always get NULL in return.
HTHEME hTheme = OpenThemeData(NULL, L"TrayNotify");
if(!hTheme)
{
//Error - I seem to get here, why?
}
The code above works with all general classes, except that one. What am I
doing wrong???
I am not familiar with such class name. You probably want one of these:
"TrayClockWClass", "TrayNotifyWnd" or "Shell_TrayWnd".
--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D
dc2000
2007-05-30 06:24:00 UTC
Permalink
Post by Grzegorz Wróbel
Post by dc2000
I seem to be stuck with a simplest thing. I need to open an XP theme for
TRAYNOTIFY area (i.e. tray notification area where the clock is displayed),
but I seem to always get NULL in return.
HTHEME hTheme = OpenThemeData(NULL, L"TrayNotify");
if(!hTheme)
{
//Error - I seem to get here, why?
}
The code above works with all general classes, except that one. What am I
doing wrong???
"TrayClockWClass", "TrayNotifyWnd" or "Shell_TrayWnd".
--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D
Thanks for your input, Grzegorz. I tried it with all 3 of your class name
suggestions and all of them returned NULL. The reason I started to use
TrayNotify is because it is included in the NORMALBLUE_INI resource for the
luna.msstyles file that is located in the "WINDOWS\Resources\Themes\Luna"
folder. All other names from that resource worked fine.

I thought that class name specified for the OpenThemeData() API is the same
as Win32 class name for controls, but now I have strong doubts about it. In
any way, again, what I need is to open that system tray part of the theme. I
know it exists, because again I can find it as a resource bmp reference in
the luna.msstyles file. Try it for yourself with an EXE resource editor.

What am I doing wrong? Anyone, who knows XP themes programming?????
Netex
2007-06-01 09:28:23 UTC
Permalink
Neither don't I have any luck on OpenThemeData() of "CLOCK", "TRAYNOTIFY",
"MENU", and "PAGE". Maybe they are reserved?

Regards,
netex
Post by dc2000
Post by Grzegorz Wróbel
Post by dc2000
I seem to be stuck with a simplest thing. I need to open an XP theme for
TRAYNOTIFY area (i.e. tray notification area where the clock is displayed),
but I seem to always get NULL in return.
HTHEME hTheme = OpenThemeData(NULL, L"TrayNotify");
if(!hTheme)
{
//Error - I seem to get here, why?
}
The code above works with all general classes, except that one. What am I
doing wrong???
"TrayClockWClass", "TrayNotifyWnd" or "Shell_TrayWnd".
--
Grzegorz Wrš®bel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D
Thanks for your input, Grzegorz. I tried it with all 3 of your class name
suggestions and all of them returned NULL. The reason I started to use
TrayNotify is because it is included in the NORMALBLUE_INI resource for the
luna.msstyles file that is located in the "WINDOWS\Resources\Themes\Luna"
folder. All other names from that resource worked fine.
I thought that class name specified for the OpenThemeData() API is the same
as Win32 class name for controls, but now I have strong doubts about it. In
any way, again, what I need is to open that system tray part of the theme. I
know it exists, because again I can find it as a resource bmp reference in
the luna.msstyles file. Try it for yourself with an EXE resource editor.
What am I doing wrong? Anyone, who knows XP themes programming?????
dc2000
2007-06-01 16:55:01 UTC
Permalink
Yes, the same here. I tried almost every suggestion & info available on the
web and nothing worked. I don't think there's a reason to keep those
reserved, is there?

Do any Microsoft MVPs have any idea????
Post by Netex
Neither don't I have any luck on OpenThemeData() of "CLOCK", "TRAYNOTIFY",
"MENU", and "PAGE". Maybe they are reserved?
Regards,
netex
Post by dc2000
Post by Grzegorz Wróbel
Post by dc2000
I seem to be stuck with a simplest thing. I need to open an XP theme for
TRAYNOTIFY area (i.e. tray notification area where the clock is displayed),
but I seem to always get NULL in return.
HTHEME hTheme = OpenThemeData(NULL, L"TrayNotify");
if(!hTheme)
{
//Error - I seem to get here, why?
}
The code above works with all general classes, except that one. What am I
doing wrong???
"TrayClockWClass", "TrayNotifyWnd" or "Shell_TrayWnd".
--
Grzegorz Wr¨®bel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D
Thanks for your input, Grzegorz. I tried it with all 3 of your class name
suggestions and all of them returned NULL. The reason I started to use
TrayNotify is because it is included in the NORMALBLUE_INI resource for the
luna.msstyles file that is located in the "WINDOWS\Resources\Themes\Luna"
folder. All other names from that resource worked fine.
I thought that class name specified for the OpenThemeData() API is the same
as Win32 class name for controls, but now I have strong doubts about it. In
any way, again, what I need is to open that system tray part of the theme. I
know it exists, because again I can find it as a resource bmp reference in
the luna.msstyles file. Try it for yourself with an EXE resource editor.
What am I doing wrong? Anyone, who knows XP themes programming?????
Jim Barry
2007-06-03 17:12:05 UTC
Permalink
Post by dc2000
Do any Microsoft MVPs have any idea????
You need to have an HWND that you can call SetWindowTheme for. Set pszSubAppName to "TrayNotifyHoriz" or "TrayNotifyVert" and leave pszSubIdList as NULL. You can then call OpenThemeData with pszClassList set to "TrayNotify".

How anyone is supposed to figure this stuff out is totally beyond me. The visual styles documentation is quite frankly abysmal, an absolute disgrace.
--
Jim Barry, MVP (Windows SDK)
dc2000
2007-06-05 20:13:02 UTC
Permalink
Post by Jim Barry
Post by dc2000
Do any Microsoft MVPs have any idea????
You need to have an HWND that you can call SetWindowTheme for. Set pszSubAppName to "TrayNotifyHoriz" or "TrayNotifyVert" and leave pszSubIdList as NULL. You can then call OpenThemeData with pszClassList set to "TrayNotify".
How anyone is supposed to figure this stuff out is totally beyond me. The visual styles documentation is quite frankly abysmal, an absolute disgrace.
--
Jim Barry, MVP (Windows SDK)
Jim, you're the man!!! Thanks a lot. You seem to be the only person who
knew. I cannot imagine there's no documentation on this subject. One question
though. What hWnd shall I use -- the one for tray window, or any window
handle? If it's a tray area handle, then I can't seem to find the way to get
it?
Jim Barry
2007-06-05 22:27:40 UTC
Permalink
Post by dc2000
Jim, you're the man!!! Thanks a lot. You seem to be the only person
who knew. I cannot imagine there's no documentation on this subject.
One question though. What hWnd shall I use -- the one for tray
window, or any window handle? If it's a tray area handle, then I
can't seem to find the way to get it?
You should use your own window. I don't think it can work across processes anyway.
--
Jim Barry, MVP (Windows SDK)
dc2000
2007-06-05 22:17:04 UTC
Permalink
Strange, I just posted a reply here and it doesn't show anywhere...

Anyways, again thanks for the help. It worked! You're the man!

What HWND shall I use -- for any window, or the one for tray window? I can't
seem to get that tray window handle easily.

I'm also trying to get a fill color for the active button on the taskbar.
I'm using this:
SetWindowTheme(hWnd, L"TaskBand", NULL);
hTheme = OpenThemeData(hWnd, L"Toolbar");
GetThemeColor(hTheme, TP_BUTTON, TS_HOT, TMT_FILLCOLORHINT, &color);

But the color is not the one. It should be dark blue for the default Windows
XP theme.

Any ideas what am I doing wrong???
Post by Jim Barry
Post by dc2000
Do any Microsoft MVPs have any idea????
You need to have an HWND that you can call SetWindowTheme for. Set pszSubAppName to "TrayNotifyHoriz" or "TrayNotifyVert" and leave pszSubIdList as NULL. You can then call OpenThemeData with pszClassList set to "TrayNotify".
How anyone is supposed to figure this stuff out is totally beyond me. The visual styles documentation is quite frankly abysmal, an absolute disgrace.
--
Jim Barry, MVP (Windows SDK)
Jim Barry
2007-06-05 23:27:16 UTC
Permalink
Post by dc2000
Strange, I just posted a reply here and it doesn't show anywhere...
Don't worry, I can see it ;-)
Post by dc2000
I'm also trying to get a fill color for the active button on the taskbar.
Sadly, there only seems to be a fill colour hint for the default button state :-(
--
Jim Barry, MVP (Windows SDK)
dc2000
2007-06-05 22:58:00 UTC
Permalink
Strange, I just posted a reply here and it doesn't show anywhere...

Anyways, again thanks for the help. It worked! You're the man!

What HWND shall I use -- for any window, or the one for tray window? I can't
seem to get that tray window handle easily.

I'm also trying to get a fill color for the active button on the taskbar.
I'm using this:
SetWindowTheme(hWnd, L"TaskBand", NULL);
hTheme = OpenThemeData(hWnd, L"Toolbar");
GetThemeColor(hTheme, TP_BUTTON, TS_HOT, TMT_FILLCOLORHINT, &color);

But the color is not the one. It should be dark blue for the default Windows
XP theme.

Any ideas what am I doing wrong???
Post by Jim Barry
Post by dc2000
Do any Microsoft MVPs have any idea????
You need to have an HWND that you can call SetWindowTheme for. Set pszSubAppName to "TrayNotifyHoriz" or "TrayNotifyVert" and leave pszSubIdList as NULL. You can then call OpenThemeData with pszClassList set to "TrayNotify".
How anyone is supposed to figure this stuff out is totally beyond me. The visual styles documentation is quite frankly abysmal, an absolute disgrace.
--
Jim Barry, MVP (Windows SDK)
Loading...