Fix a wrong backgound color setting, seen with a Delphi Programm (microSPS.exe)

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Oct 18 12:25:29 CDT 2011


The application delivers 0x1fffffff as COLORREF to EM_SETBKGNDCOLOR. Wine
sees this as 0x00ffffff and so I get white characters on a white background,
while on windows the application has a black background. A WINEDEBUG=+all
log shows no such return value before.
Fixing this value makes the application display as expected. The application
at http://microsps.net/Downloads/Benutzeroberflaeche_V1_04i.zip can be run
to show the error without actual hardware.
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 5a75d54b93272479168b9fad6738791bf290e845 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de>
Date: Tue, 18 Oct 2011 19:13:41 +0200
Subject: Fix a wrong backgound color setting, seen with a Delphi Programm (microSPS.exe)

---
 dlls/riched20/editor.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 5dda1ea..3d5137c 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3326,7 +3326,13 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
     }
     else
     {
-      editor->rgbBackColor = lParam;
+      if(lParam >0xfffffff)
+      {
+          ERR("Application sent invalid COLORREF 0x%08lx\n", lParam);
+          editor->rgbBackColor = 0;
+      }
+      else
+          editor->rgbBackColor = (lParam == 0x1fffffff)?0:lParam;
       editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor);
     }
     ITextHost_TxInvalidateRect(editor->texthost, NULL, TRUE);
-- 
1.7.3.4




More information about the wine-patches mailing list