Hi,

Attached is a first pass at a patch to fix various issues with the GVIM Window on Windows when building with Visual Studio 2012. I have tested that VS2010 are still ok, but it needs testing with other Windows compilers - VC6, 7, 8 and 9, Borland C, Mingw and so on.

TTFN

Mike
--
There you go thinking again!

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


diff --git a/src/gui_w32.c b/src/gui_w32.c
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1692,8 +1692,10 @@ gui_mch_set_shellsize(int width, int hei
     }
 
     /* compute the size of the outside of the window */
-    win_width = width + GetSystemMetrics(SM_CXFRAME) * 2;
-    win_height = height + GetSystemMetrics(SM_CYFRAME) * 2
+    win_width = width + (GetSystemMetrics(SM_CXFRAME) +
+                         GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+    win_height = height + (GetSystemMetrics(SM_CYFRAME) +
+                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
                        + GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
                        + gui_mswin_get_menu_height(FALSE)
@@ -2544,13 +2546,15 @@ gui_mch_get_screen_dimensions(int *scree
     get_work_area(&workarea_rect);
 
     *screen_w = workarea_rect.right - workarea_rect.left
-               - GetSystemMetrics(SM_CXFRAME) * 2;
+               - (GetSystemMetrics(SM_CXFRAME) +
+                   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
 
     /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
      * the menubar for MSwin, we subtract it from the screen height, so that
      * the window size can be made to fit on the screen. */
     *screen_h = workarea_rect.bottom - workarea_rect.top
-               - GetSystemMetrics(SM_CYFRAME) * 2
+               - (GetSystemMetrics(SM_CYFRAME) +
+                   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
                - GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
                - gui_mswin_get_menu_height(FALSE)
@@ -3180,12 +3184,14 @@ gui_mch_dialog(
        /* Use our own window for the size, unless it's very small. */
        GetWindowRect(s_hwnd, &rect);
        maxDialogWidth = rect.right - rect.left
-                                          - GetSystemMetrics(SM_CXFRAME) * 2;
+                                  - (GetSystemMetrics(SM_CXFRAME) +
+                                      GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
        if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
            maxDialogWidth = DLG_MIN_MAX_WIDTH;
 
        maxDialogHeight = rect.bottom - rect.top
-                                          - GetSystemMetrics(SM_CXFRAME) * 2;
+                                  - (GetSystemMetrics(SM_CXFRAME) +
+                                      GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
        if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
            maxDialogHeight = DLG_MIN_MAX_HEIGHT;
     }
diff --git a/src/gui_w48.c b/src/gui_w48.c
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2907,9 +2907,11 @@ gui_mswin_get_valid_dimensions(
     int            base_width, base_height;
 
     base_width = gui_get_base_width()
-       + GetSystemMetrics(SM_CXFRAME) * 2;
+       + (GetSystemMetrics(SM_CXFRAME) +
+           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
     base_height = gui_get_base_height()
-       + GetSystemMetrics(SM_CYFRAME) * 2
+       + (GetSystemMetrics(SM_CYFRAME) +
+           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
        + GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
        + gui_mswin_get_menu_height(FALSE)
@@ -3272,9 +3274,11 @@ gui_mch_newfont()
 
     GetWindowRect(s_hwnd, &rect);
     gui_resize_shell(rect.right - rect.left
-                       - GetSystemMetrics(SM_CXFRAME) * 2,
+                       - (GetSystemMetrics(SM_CXFRAME) +
+                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
                     rect.bottom - rect.top
-                       - GetSystemMetrics(SM_CYFRAME) * 2
+                       - (GetSystemMetrics(SM_CYFRAME) +
+                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
                        - GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
                        - gui_mswin_get_menu_height(FALSE)
diff --git a/src/os_win32.h b/src/os_win32.h
--- a/src/os_win32.h
+++ b/src/os_win32.h
@@ -102,6 +102,10 @@
 #endif
 #ifndef PROTO
 # include <windows.h>
+# ifdef SM_CXPADDEDBORDER
+#   undef SM_CXPADDEDBORDER
+# endif
+# define SM_CXPADDEDBORDER      92
 #endif
 
 /*

Raspunde prin e-mail lui