Click to See Complete Forum and Search --> : Image of CTreeView
dvsnow
November 24th, 2006, 08:20 AM
When i run my app in Window classis style, color scheme is Hight Contrast Black , then i show an TreeView to select a folder. Then I change Window style to Windows XP style, color scheme is normal, the background of Image of TreeView (folder icon,...)is not change to System Color. How do i cant change this to system color.
Pls, help me!
Thanks alot!
usman999_1
November 24th, 2006, 09:04 AM
Are you handling this???
WM_THEMECHANGED Notification
The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.
A window receives this message through its WindowProc function.
Hope this helps,
Regards,
Usman.
dvsnow
November 24th, 2006, 09:20 AM
Yes, I handing CTreeView class
usman999_1
November 24th, 2006, 09:44 AM
And what are you doing (show us the code) in that message handler for WM_THEMECHANGED???
dvsnow
November 24th, 2006, 08:08 PM
I haven't just done anythings to handler this message yet.
Which do nothing, the treeview is display as the picture i posted.
So, i need your help.
dvsnow
November 26th, 2006, 11:06 PM
I'm trying to handler WM_THEMECHANGED message, but i has errors:
code:
LRESULT CFolderTreeCtrl::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_THEMECHANGED:
if (hTheme)
{
ThemeHelper.CloseThemeData(hTheme);
ThemeHelper.OpenThemeData(hTheme,L"TreeView");
}
break;
default:
break;
}
}
the error is:
E:\Document\PIFD4\Item\FolderTreeCtrl.cpp(671) : error C2065: 'WM_THEMECHANGED' : undeclared identifier
E:\Document\PIFD4\Item\FolderTreeCtrl.cpp(671) : error C2051: case expression not constant
E:\Document\PIFD4\Item\FolderTreeCtrl.cpp(675) : error C2664: 'OpenThemeData' : cannot convert parameter 1 from 'void *' to 'struct HWND__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Why it not done.
I has included : "uxtheme.h"
NoHero
November 27th, 2006, 02:13 AM
It is pretty hard to explain and fix the last two compiler problems, since we do not see the code for the Theme Helper. But I can sure tell you the first: WM_THEMECHANGED is available on Windows NT 5.1 (XP) only. Therefore you need to set the proper macros:
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
Albeit I believe it is not a problem with the theme, rather with the missing or wrong alpha color specified for the transparency.
dvsnow
November 27th, 2006, 09:21 PM
Thanks alot!
With your seggsion, i try to set background color to system color and it OK.
Now, I want to ask you a new question.
When I use SHBrowserForFolder function, it display and dialog box. How can I update IamgeList in this dialog box when style of window is changed?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.