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