Andy,

> Most interesting, as DefWindowProc is still called. So I guess that
> indicates that _something_ goes wrong inside it. It doesn't bother to put
> anything but "Operation successfully completed" or something like that into
> GetLastError() though...

It seems I found what actually is wrong. In gui_w32.c we create ASCII
window class for text area, but _TextAreaWndProc forwards messages to
vim_WindowProc which in turn might call wide window proc!
The solution is to create wide text area window class if parent window is wide.

Attached patch solved my problem. Can you please try it and check
whether this helps you too or not.


-- 
Sergey Khorev
http://sites.google.com/site/khorser
Can anybody think of a good tagline I can steal?

-- 
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
diff -r 8a0a8f10b43e src/gui_w32.c
--- a/src/gui_w32.c     Wed Feb 03 18:14:49 2010 +0100
+++ b/src/gui_w32.c     Thu Feb 04 09:00:40 2010 +0300
@@ -1329,6 +1329,7 @@
     WNDCLASS wndclass;
 #ifdef FEAT_MBYTE
     const WCHAR szVimWndClassW[] = VIM_CLASSW;
+    const WCHAR szTextAreaClassW[] = L"VimTextArea";
     WNDCLASSW wndclassw;
 #endif
 #ifdef GLOBAL_IME
@@ -1479,6 +1480,28 @@
 #endif
 
     /* Create the text area window */
+#ifdef FEAT_MBYTE
+    if (wide_WindowProc)
+    {
+       if (GetClassInfoW(s_hinst, szTextAreaClassW, &wndclassw) == 0)
+       {
+           wndclassw.style = CS_OWNDC;
+           wndclassw.lpfnWndProc = _TextAreaWndProc;
+           wndclassw.cbClsExtra = 0;
+           wndclassw.cbWndExtra = 0;
+           wndclassw.hInstance = s_hinst;
+           wndclassw.hIcon = NULL;
+           wndclassw.hCursor = LoadCursor(NULL, IDC_ARROW);
+           wndclassw.hbrBackground = NULL;
+           wndclassw.lpszMenuName = NULL;
+           wndclassw.lpszClassName = szTextAreaClassW;
+
+           if (RegisterClassW(&wndclassw) == 0)
+               return FAIL;
+       }
+    }
+    else
+#endif
     if (GetClassInfo(s_hinst, szTextAreaClass, &wndclass) == 0)
     {
        wndclass.style = CS_OWNDC;
diff -r 8a0a8f10b43e src/gui_w48.c
--- a/src/gui_w48.c     Wed Feb 03 18:14:49 2010 +0100
+++ b/src/gui_w48.c     Thu Feb 04 09:00:40 2010 +0300
@@ -1084,13 +1084,6 @@
        case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam);
            return TRUE;
 #endif
-       /* Workaround for the problem that MyWindowProc() returns FALSE on 64
-        * bit windows when cross-compiled using Mingw libraries. (Andy
-        * Kittner) */
-       case WM_NCCREATE:
-           MyWindowProc(hwnd, uMsg, wParam, lParam);
-           return TRUE;
-
        default:
            return MyWindowProc(hwnd, uMsg, wParam, lParam);
     }

Reply via email to