Re: uxtheme: also send WM_THEMECHANGED to child windows
On Sun, 2005-07-03 at 15:11 +0200, Frank Richter wrote:
+static void UXTHEME_broadcast_themechange (HWND hWnd) +{ + if (hWnd == NULL) + { + EnumWindows (UXTHEME_EnumChildProc, 0); + } + else + { + if (hWnd != NULL) PostMessageW(hWnd, WM_THEMECHANGED, 0, 0); + EnumChildWindows (hWnd, UXTHEME_EnumChildProc, 0); + } +}
This function would be more useful (and usage clearer) if it took the msg as an argument (also I think you can get rid of UXTHEME_EnumChildProc too, untested): +static BOOL UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg) +{ + if (hWnd == NULL) + { + EnumWindows (UXTHEME_broadcast_msg, msg); + } + else + { + PostMessageW(hWnd, msg, 0, 0); + EnumChildWindows (hWnd, UXTHEME_broadcast_msg, msg); + } + return TRUE; +} Note: the 'if' for PostMessageW was superfluous. -- Dimi Paun <dimi(a)lattica.com> Lattica, Inc.
On 03.07.2005 18:01, Dimi Paun wrote:
This function would be more useful (and usage clearer) if it took the msg as an argument (also I think you can get rid of UXTHEME_EnumChildProc too, untested):
True.
Note: the 'if' for PostMessageW was superfluous.
Well, technically, according to MSDN for NULL: "The function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread." Practically it's probably as good as not posting it all. -f.r.
participants (3)
-
Dimi Paun -
Frank Richter -
Frank Richter