Resend: CW: Progress control creation fixes

Dmitry Timoshkov dmitry at baikal.ru
Sun Feb 3 04:48:00 CST 2002


Hello.

This is a part of the big CodeWeavers' patch, adapted for current CVS.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Moved style correcting code to the WM_CREATE handler and added
    clearing of WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE as in Windows.
    Added SetWindowPos(SWP_FRAMECHANGED) to make changes take effect.

--- cvs/hq/wine/dlls/comctl32/progress.c	Thu Jan 31 12:32:16 2002
+++ wine/dlls/comctl32/progress.c	Sun Feb  3 18:21:08 2002
@@ -64,7 +64,7 @@
     /* draw the background */
     FillRect(hdc, &rect, hbrBk);
 
-    rect.left++; rect.right--; rect.top++; rect.bottom--;
+    InflateRect(&rect, -1, -1);
 
     /* get the window style */
     dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
@@ -202,17 +202,20 @@
     PROGRESS_INFO *infoPtr = (PROGRESS_INFO *)GetWindowLongW(hwnd, 0);
     DWORD dwExStyle;
     UINT temp;
-  
-    if (!infoPtr && message != WM_CREATE && message != WM_NCCREATE)
+
+    if (!infoPtr && message != WM_CREATE)
         return DefWindowProcW( hwnd, message, wParam, lParam ); 
-  
+
     switch(message) {
-    case WM_NCCREATE:
+    case WM_CREATE:
         dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
+	dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);
+	dwExStyle |= WS_EX_STATICEDGE;
         SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_STATICEDGE);
-        return TRUE;
+	/* Force recalculation of a non-client area */
+	SetWindowPos(hwnd, 0, 0, 0, 0, 0,
+	    SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
 
-    case WM_CREATE:
         /* allocate memory for info struct */
         infoPtr = (PROGRESS_INFO *)COMCTL32_Alloc (sizeof(PROGRESS_INFO));
         if (!infoPtr) return -1;








More information about the wine-patches mailing list