From 387fa04f750d21b7482188a7c291d2533a5e84b5 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sun, 15 Mar 2015 13:37:13 +0000 Subject: [PATCH] [USER32] - Implement RealUserDrawCaption and pass it to uxtheme in order to paint the classic caption when needed. CORE-9016 svn path=/trunk/; revision=66722 --- reactos/win32ss/user/user32/misc/usrapihk.c | 3 ++- reactos/win32ss/user/user32/windows/defwnd.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/reactos/win32ss/user/user32/misc/usrapihk.c b/reactos/win32ss/user/user32/misc/usrapihk.c index 61a5e04202e..b0df579cfa5 100644 --- a/reactos/win32ss/user/user32/misc/usrapihk.c +++ b/reactos/win32ss/user/user32/misc/usrapihk.c @@ -28,6 +28,7 @@ INT WINAPI RealSetScrollInfo(HWND,int,LPCSCROLLINFO,BOOL); BOOL WINAPI RealSystemParametersInfoA(UINT,UINT,PVOID,UINT); BOOL WINAPI RealSystemParametersInfoW(UINT,UINT,PVOID,UINT); DWORD WINAPI GetRealWindowOwner(HWND); +LRESULT WINAPI RealUserDrawCaption(HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags); /* GLOBALS *******************************************************************/ @@ -154,7 +155,7 @@ ResetUserApiHook(PUSERAPIHOOK puah) puah->SystemParametersInfoW = (FARPROC)RealSystemParametersInfoW; puah->ForceResetUserApiHook = (FARPROC)ForceResetUserApiHook; puah->DrawFrameControl = (FARPROC)RealDrawFrameControl; - puah->DrawCaption = (FARPROC)NtUserDrawCaption; + puah->DrawCaption = (FARPROC)RealUserDrawCaption; puah->MDIRedrawFrame = (FARPROC)RealMDIRedrawFrame; puah->GetRealWindowOwner = (FARPROC)GetRealWindowOwner; } diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index a24fab18270..20c51698f26 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -398,6 +398,16 @@ UserSendUiUpdateMsg(HWND hwnd, LPARAM lParam) return TRUE; } +/* + RealUserDrawCaption: This function is passed through RegisterUserApiHook to uxtheme + to call it when the classic caption is needed to be drawn. + */ +LRESULT WINAPI +RealUserDrawCaption(HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags) +{ + return DefWndNCPaint(hWnd, HRGN_WINDOW, -1); +} + static void UserPaintCaption(HWND hwnd) { @@ -411,6 +421,11 @@ UserPaintCaption(HWND hwnd) */ if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK) { + /* + * This will cause uxtheme to either paint the themed caption or call + * RealUserDrawCaption in order to draw the classic caption when themes + * are disabled but the themes service is enabled + */ SendMessage(hwnd, WM_NCUAHDRAWCAPTION,0,0); } else