0 out of 1 rated this helpful - Rate this topic

WM_THEMECHANGED message

Applies to: desktop apps only

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.

#define WM_THEMECHANGED                 0x031A

Parameters

wParam

This parameter is reserved.

lParam

This parameter is reserved.

Return value

Type: LRESULT

If an application processes this message, it should return zero.

Remarks

A window receives this message through its WindowProc function.

Note  This message is posted by the operating system. Applications typically do not send this message.

Themes are specifications for the appearance of controls, so that the visual element of a control is treated separately from its functionality.

To release an existing theme handle, call CloseThemeData. To acquire a new theme handle, use OpenThemeData.

Following the WM_THEMECHANGED broadcast, any existing theme handles are invalid. A theme-aware window should release and reopen any of its pre-existing theme handles when it receives the WM_THEMECHANGED message. If the OpenThemeData function returns NULL, the window should paint unthemed.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winuser.h (include Windows.h)

See also

Other Resources
CloseThemeData
IsThemeActive
OpenThemeData

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Message only sent from On->Off transition (i.e. deactivation)

It should be noted that the WM_THEMECHANGED message is only sent during an On->Off transition of themes (i.e. turning themes off), as noted in Microsoft Connect ticket https://connect.microsoft.com/VisualStudio/feedback/details/123811/wm-themechanged-not-sent-after-re-enabling-xp-visual-style





$0$0 $0 $0It is not sent when re-enabling themes, or when changing themes.$0 $0$0 $0 $0e.g. changing theme from -> to:$0 $0$0 $0 $0 $0 $0Windows 7 Aero -> Windows Classic: WM_THEMECHANGED$0 $0Windows 7 Aero -> Windows 7 Standard: none$0 $0Windows 7 Standard -> Windows 7 Aero: none$0 $0Windows 7 Standard -> Windows Classic: WM_THEMECHANGED$0 $0Windows Classic -> Windows 7 Aero: none$0 $0Windows Classic -> Windows 7 Standard: none$0 $0 $0 $0$0 $0 $0$0 $0

Constant Value
Constant definition for Visual Basic 9
Const WM_THEMECHANGED As Integer = &H31A