SetWindowTheme and "child" windows

SetWindowTheme and "child" windows

Post by Al » Thu, 03 Jul 2003 00:00:41



Hi,

   I am seeking to promulgate the new theme of a MDI form
to all it children, this includes non MDI forms and any
apps like Word that would be started from the parent. Are
the themes inheritable by "child" forms and processes
spawned from them ?

The SetWindowTheme function speaks of changing
the "visual style". The current documentation draws a
distinction between Visual Styles and Themes which are
defined in .theme files. I am seeking to change the theme
of the desktop and all forms on it. I do not see where
a .theme file is specified in the SetWindowTheme call so
I am wondering if this method is dealing with visual
styles instead of themes.

Thanks
Al

 
 
 

SetWindowTheme and "child" windows

Post by Chris Fortier [MSFT » Thu, 03 Jul 2003 15:36:14


Themes are set on a global basis and only through the Display CPL.  Once a
theme is selected, almost all applications (not console windows or appcompat
shimmed windows) , including your MDI form, will change to incorporate the
look and feel of the chosen theme.  You really don't have to do anything.

Related to this though, are the common controls in COMCTL32.  Only COMCTL32
V6 is theme aware, so your application must use a manifest to achieve a
themed look down to the control level.

As far as the second part of your question, yes, there is a distinction.  A
.theme file is just a .ini file that points to a collection of files that
are used to define the complete semantics of a theme.  Such items include
the visual styles definition file, sound files, cursor files, background
bitmaps, etc.  The visual styles definition file contains definitions for
all theme properties related to UI classes/parts/states.  As an app cannot
manipulate .theme files, themes are used to refer to functionality contained
in the visual style definition file.

SetWindowTheme is used to override the default window theme class for that
particular window.  This allows an app to override the window's look and
feel, but only within the same theme.  For example, if I wanted my Rebar to
look like a theoretical Explorer Rebar I'd use SetWindowTheme(hwndRebar,
"Explorer::Rebar", NULL).  Note that this has limited utility in Windows XP
as almost all theme classes are visually distinct.  Only when there is some
sort of commonality between classes is this useful.  This is why there are a
couple of COMCTL32 messages that are just wrappers around SetWindowTheme
(RB_SETWINDOWTHEME and TB_SETWINDOWTHEME).


Quote:> Hi,

>    I am seeking to promulgate the new theme of a MDI form
> to all it children, this includes non MDI forms and any
> apps like Word that would be started from the parent. Are
> the themes inheritable by "child" forms and processes
> spawned from them ?

> The SetWindowTheme function speaks of changing
> the "visual style". The current documentation draws a
> distinction between Visual Styles and Themes which are
> defined in .theme files. I am seeking to change the theme
> of the desktop and all forms on it. I do not see where
> a .theme file is specified in the SetWindowTheme call so
> I am wondering if this method is dealing with visual
> styles instead of themes.

> Thanks
> Al