https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03c09c9e2c72e44d967002ea3265f19f3ad2ce13

commit 03c09c9e2c72e44d967002ea3265f19f3ad2ce13
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Tue Apr 28 20:56:18 2020 +0900
Commit:     GitHub <[email protected]>
CommitDate: Tue Apr 28 20:56:18 2020 +0900

    [SHIMGVW] Correctly draw display border (#2687)
    
    Use WS_EX_CLIENTEDGE extended style for display window.
    Fix message WM_SIZE handling. CORE-16983
---
 dll/win32/shimgvw/shimgvw.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index 9215eae87bb..e06af9159d5 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -900,7 +900,7 @@ ImageView_InitControls(HWND hwnd)
 
     if (shiSettings.Maximized) ShowWindow(hwnd, SW_MAXIMIZE);
 
-    hDispWnd = CreateWindowEx(0, WC_STATIC, _T(""),
+    hDispWnd = CreateWindowEx(WS_EX_CLIENTEDGE, WC_STATIC, _T(""),
                               WS_CHILD | WS_VISIBLE,
                               0, 0, 0, 0, hwnd, NULL, hInstance, NULL);
 
@@ -919,6 +919,25 @@ ImageView_OnMouseWheel(HWND hwnd, INT x, INT y, INT 
zDelta, UINT fwKeys)
     }
 }
 
+static VOID
+ImageView_OnSize(HWND hwnd, UINT state, INT cx, INT cy)
+{
+    RECT rc;
+
+    SendMessage(hToolBar, TB_AUTOSIZE, 0, 0);
+
+    GetWindowRect(hToolBar, &rc);
+
+    MoveWindow(hDispWnd, 0, 0, cx, cy - (rc.bottom - rc.top), TRUE);
+
+    /* is it maximized or restored? */
+    if (state == SIZE_MAXIMIZED || state == SIZE_RESTORED)
+    {
+        /* reset zoom */
+        ResetZoom();
+    }
+}
+
 LRESULT CALLBACK
 ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
@@ -1065,17 +1084,8 @@ ImageView_WndProc(HWND hwnd, UINT Message, WPARAM 
wParam, LPARAM lParam)
         }
         case WM_SIZE:
         {
-            RECT rc;
-            SendMessage(hToolBar, TB_AUTOSIZE, 0, 0);
-            GetWindowRect(hToolBar, &rc);
-            MoveWindow(hDispWnd, 1, 1, LOWORD(lParam) - 1, HIWORD(lParam) - 
(rc.bottom - rc.top) - 1, TRUE);
-            /* is it maximized or restored? */
-            if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED)
-            {
-                /* reset zoom */
-                ResetZoom();
-            }
-            return 0L;
+            ImageView_OnSize(hwnd, (UINT)wParam, GET_X_LPARAM(lParam), 
GET_Y_LPARAM(lParam));
+            return 0;
         }
         case WM_DESTROY:
         {

Reply via email to