[try 2] user32/defwnd.c: Let user defined proc repaint caption in case WM_SETTEXT and WM_SETICON

Kirill K. Smirnov lich at math.spbu.ru
Thu Jan 11 07:43:12 CST 2007


Please, ignore my prev patch, I've typed there.
-------------- next part --------------
diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c
index 9278ddd..67b67d7 100644
--- a/dlls/user32/defwnd.c
+++ b/dlls/user32/defwnd.c
@@ -676,8 +676,11 @@ static LRESULT DEFWND_DefWinProc( HWND h
 
             USER_Driver->pSetWindowIcon( hwnd, wParam, (HICON)lParam );
 
-            SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
-                         SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
+            /*
+             * Repaint Caption.
+             * Let user defined window proc handle this.
+             */
+            SendMessageW(hwnd, WM_NCPAINT, 1, 0);
 
             return (LRESULT)ret;
         }
@@ -791,8 +794,12 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd
 
     case WM_SETTEXT:
         DEFWND_SetTextA( hwnd, (LPCSTR)lParam );
-        if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION )
-            NC_HandleNCPaint( hwnd , (HRGN)1 );  /* Repaint caption */
+        /*
+         * Repaint Caption.
+         * Do not call NC_HandleNCPaint directly.
+         * Let user defined window proc handle this.
+         */
+        SendMessageA( hwnd, WM_NCPAINT, 1, 0 );
         result = 1; /* success. FIXME: check text length */
         break;
 
@@ -929,8 +936,12 @@ LRESULT WINAPI DefWindowProcW(
 
     case WM_SETTEXT:
         DEFWND_SetTextW( hwnd, (LPCWSTR)lParam );
-        if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION )
-            NC_HandleNCPaint( hwnd , (HRGN)1 );  /* Repaint caption */
+        /*
+         * Repaint Caption.
+         * Do not call NC_HandleNCPaint directly.
+         * Let user defined window proc handle this.
+         */
+        SendMessageW( hwnd, WM_NCPAINT, 1, 0 );
         result = 1; /* success. FIXME: check text length */
         break;
 


More information about the wine-patches mailing list