From 137420a0f0f13cd7026385826d4596f9f25a8359 Mon Sep 17 00:00:00 2001
From: Bill Medland <medbi01@accpac.com>
Date: Wed, 11 Jul 2001 17:26:33 +0000
Subject: [PATCH] Correct the location of the style patching for the edit
 control.

---
 controls/edit.c  | 17 ++++++++---------
 windows/dialog.c |  6 ++++++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/controls/edit.c b/controls/edit.c
index a76c7d09941..717c7a9c4ca 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -4408,8 +4408,8 @@ static LRESULT EDIT_WM_NCCreate(WND *wnd, DWORD style, HWND hwndParent, BOOL uni
 	EDITSTATE *es;
 	UINT alloc_size;
 
-	TRACE("Creating %s edit control, style = %08lx\n",
-		unicode ? "Unicode" : "ANSI", style);
+	TRACE("Creating %s edit control, style = %08lx %08lx\n",
+		unicode ? "Unicode" : "ANSI", style, wnd->dwExStyle);
 
 	if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es))))
 		return FALSE;
@@ -4429,16 +4429,15 @@ static LRESULT EDIT_WM_NCCreate(WND *wnd, DWORD style, HWND hwndParent, BOOL uni
 	/*
 	 * In Win95 look and feel, the WS_BORDER style is replaced by the 
 	 * WS_EX_CLIENTEDGE style for the edit control. This gives the edit 
-	 * control a non client area.
+	 * control a non client area.  Not always.  This coordinates in some
+         * way with the window creation code in dialog.c  When making 
+         * modifications please ensure that the code still works for edit
+         * controls created directly with style 0x50800000, exStyle 0 (
+         * which should have a single pixel border)
 	 */
 	if (TWEAK_WineLook != WIN31_LOOK)
 	{
-	  if (es->style & WS_BORDER)
-	  {
-	    es->style      &= ~WS_BORDER;
-	    wnd->dwStyle   &= ~WS_BORDER;
-	    wnd->dwExStyle |= WS_EX_CLIENTEDGE;
-	  }
+	  es->style      &= ~WS_BORDER;
 	}
 	else
 	{
diff --git a/windows/dialog.c b/windows/dialog.c
index 5a2db791327..449b016239d 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -479,6 +479,12 @@ static BOOL DIALOG_CreateControls( WND *pWnd, LPCSTR template,
         {
             template = (LPCSTR)DIALOG_GetControl32( (WORD *)template, &info,
                                                     dlgTemplate->dialogEx );
+            /* Is this it? */
+            if (info.style & WS_BORDER)
+            {
+                info.style &= ~WS_BORDER;
+                info.exStyle |= WS_EX_CLIENTEDGE;
+            }
             hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
                                           (LPCWSTR)info.className,
                                           (LPCWSTR)info.windowName,
-- 
GitLab