edit - fix WantReturns (Win BUG)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like Windows has an old BUG in Edit control when handling WM_GetDlgCode message.
It always returns 0x8D no mater what the style and and properties of a window is.
Interesting enough, Delphi relays on this behavior.

Vitaliy Margolen

changelog:
  - controls/edit.c
    fix problem with capturing [return] keys in multi-line edits

    
Index: controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.112
diff -u -r1.112 edit.c
--- controls/edit.c     6 May 2003 18:23:17 -0000       1.112
+++ controls/edit.c     12 May 2003 02:12:31 -0000
@@ -744,23 +744,10 @@
          */
 
        case WM_GETDLGCODE:
-               result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS;
-
-               if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
-               {
-                  int vk = (int)((LPMSG)lParam)->wParam;
-
-                  if (vk == VK_RETURN && (GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN))
-                  {
-                     result |= DLGC_WANTMESSAGE;
-                  }
-                  else if (es->hwndListBox && (vk == VK_RETURN || vk == VK_ESCAPE))
-                  {
-                     if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0))
-                        result |= DLGC_WANTMESSAGE;
-                  }
-               }
-               break;
+               result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS
+                         | DLGC_WANTMESSAGE;
+                /* Windows BUG! Windows always returns DLGC_WANTMESSAGE flag without additional checks. */
+                break;
 
        case WM_CHAR:
        {



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux