Index: trunk/src/user32/Makefile
===================================================================
--- trunk/src/user32/Makefile	(revision 5494)
+++ trunk/src/user32/Makefile	(revision 5496)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.81 2001-03-30 11:14:35 sandervl Exp $
+# $Id: Makefile,v 1.82 2001-04-12 14:04:32 sandervl Exp $
 
 #
@@ -94,4 +94,5 @@
 $(OBJDIR)\win32wdesktop.obj \
 $(OBJDIR)\win32wbasenonclient.obj \
+$(OBJDIR)\oldnls32.obj \
 $(OBJDIR)\user32rsrc.obj
 
Index: trunk/src/user32/USER32.DEF
===================================================================
--- trunk/src/user32/USER32.DEF	(revision 5494)
+++ trunk/src/user32/USER32.DEF	(revision 5496)
@@ -1,3 +1,3 @@
-; $Id: USER32.DEF,v 1.51 2001-04-05 09:31:27 sandervl Exp $
+; $Id: USER32.DEF,v 1.52 2001-04-12 14:04:32 sandervl Exp $
 
 LIBRARY USER32 INITINSTANCE TERMINSTANCE
@@ -674,2 +674,12 @@
 
     _CreateFakeWindowEx@4                                        @2028 NONAME
+
+;----------------------------------
+; obsolete WINNLS APIs (Far East)
+;----------------------------------
+    SendIMEMessageExA          = _SendIMEMessageExA@8
+    SendIMEMessageExW          = _SendIMEMessageExW@8
+
+    WINNLSEnableIME            = _WINNLSEnableIME@8
+    WINNLSGetEnableStatus      = _WINNLSGetEnableStatus@4
+    WINNLSGetIMEHotkey         = _WINNLSGetIMEHotkey@4
Index: trunk/src/user32/icontitle.cpp
===================================================================
--- trunk/src/user32/icontitle.cpp	(revision 5494)
+++ trunk/src/user32/icontitle.cpp	(revision 5496)
@@ -1,3 +1,3 @@
-/* $Id: icontitle.cpp,v 1.5 2000-02-16 14:34:20 sandervl Exp $ */
+/* $Id: icontitle.cpp,v 1.6 2001-04-12 14:04:32 sandervl Exp $ */
 /*
  * Icontitle window class.
@@ -69,5 +69,5 @@
 {
     LPSTR str;
-    int length = wnd->getOwner()->GetWindowTextLength();
+    int length = wnd->getOwner()->GetWindowTextLengthA();
 
     if( length )
Index: trunk/src/user32/oldnls32.cpp
===================================================================
--- trunk/src/user32/oldnls32.cpp	(revision 5496)
+++ trunk/src/user32/oldnls32.cpp	(revision 5496)
@@ -0,0 +1,225 @@
+/*
+	winnls32.cpp
+	
+*/
+
+#include <odin.h>
+#include <os2win.h>
+#include <odinwrap.h>
+#include "oldnls32.h"
+
+
+/*
+	BOOL IMPGetIME(hwnd, lpimepro)
+
+	Get Current IME Information
+	(HWND, InstallDate, Version, Description, FileName, Options on start...)
+	
+	to invoke:
+		hnwd ... NULL
+	result:
+	not 0 ... success (infomation will be stored to lpimepro)
+	0 ... failure
+	
+	see also:
+		ImmGetDefaultIMEWnd
+		ImmGetDescription
+		ImmGetIMEFileName
+		ImmGetProperty
+*/
+
+BOOL WINAPI IMPGetIMEA(HWND hwnd, LPIMEPROA lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPGetIMEA not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+BOOL WINAPI IMPGetIMEW(HWND hwnd, LPIMEPROW lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPGetIMEW not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+
+/*
+	BOOL IMPQueryIME(lpimepro)
+
+	Get(Enum) IMEs Information
+	(HWND, InstallDate, Version, Description, FileName, Options on start...)
+	
+	to invoke:
+	first : lpimepro->szName[0] = 0
+	next to last : (must not modify any contents in lpimepro)
+	
+	result:
+	not 0 ... success
+		lpimepro->hWnd ... HANDLE to the IME window (if loaded)
+		                   or NULL(if not)
+	0 ... failure, or end of list
+
+	see also:
+		ImmGetDefaultIMEWnd
+		ImmGetDescription
+		ImmGetIMEFileName
+		ImmGetProperty
+*/
+
+BOOL WINAPI IMPQueryIMEA(LPIMEPROA lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPQueryIMEA not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+BOOL WINAPI IMPQueryIMEW(LPIMEPROW lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPQueryIMEW not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+
+/*
+	BOOL IMPSetIME(hwnd, lpimepro)
+	
+	Switch active IME
+	
+	to invoke:
+		hwnd = NULL
+		lpimepro = IME to switch
+	result:
+	not 0 ... success
+	0 ... failure
+	
+	see also:
+		ImmAssociateContext
+*/
+
+BOOL WINAPI IMPSetIMEA(HWND hwnd, LPIMEPROA lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPSetIMEA not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+BOOL WINAPI IMPSetIMEW(HWND hwnd, LPIMEPROW lpip)
+{
+#ifdef DEBUG
+	dprintf(("USER32: IMPSetIMEW not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return FALSE;
+}
+
+
+/*
+	UINT WINNLSGetIMEHotkey(hwnd)
+	
+	Query Virtual Key code to open the IME
+	
+	to invoke:
+		hnwd ... HANDLE to the IME window
+	result:
+		Virtual Key code, or NULL
+		
+	see also:
+		ImmSimulateHotKey
+*/
+
+UINT WINAPI WINNLSGetIMEHotkey(HWND hwnd)
+{
+#ifdef DEBUG
+	dprintf(("USER32: WINNLSGetIMEHotKey not implemented\n"));
+#endif
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	return (UINT)NULL;
+}
+
+
+/*
+	BOOL WINNLSEnableIME(hwnd, bool)
+	
+	make IME open/close
+	
+	to invoke:
+		hwnd ... NULL
+		bool ... TRUE (open) or FALSE (close)
+	result:
+		previous state
+	
+	see also:
+		ImmGetOpenStatus
+		ImmSetOpenStatus
+		ImmSimulateHotKey
+*/
+
+BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL bOpen)
+{
+#ifdef DEBUG
+	dprintf(("USER32: WINNLSEnableIME not implemented\n"));
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+#endif
+	return FALSE;
+}
+
+
+/*
+	BOOL WINNLSGetEnableStatus(hwnd)
+
+	Query IME open/close
+	
+	to invoke:
+		hwnd ... NULL
+	result:
+		not 0 ... open
+		0 ... close
+	
+	see also:
+		ImmGetOpenStatus
+*/
+
+BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
+{
+#ifdef DEBUG
+	dprintf(("USER32: WINNLSGetEnableStatus not implemented\n"));
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+#endif
+	return FALSE;
+}
+
+
+/*
+	LRESULT WINAPI SendIMEMessageEx(hwnd, lparam)
+*/
+
+
+LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lparam)
+{
+#ifdef DEBUG
+	dprintf(("USER32: SendIMEMessageExA not implemented\n"));
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+#endif
+	return (LRESULT)0;
+}
+
+LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lparam)
+{
+#ifdef DEBUG
+	dprintf(("USER32: SendIMEMessageExW not implemented\n"));
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+#endif
+	return (LRESULT)0;
+}
+
Index: trunk/src/user32/oldnls32.h
===================================================================
--- trunk/src/user32/oldnls32.h	(revision 5496)
+++ trunk/src/user32/oldnls32.h	(revision 5496)
@@ -0,0 +1,112 @@
+/*
+	oldnls32
+	
+	obsolete APIs for FarEast-compliant NLS support
+*/
+
+
+#ifndef _OLDNLS32_
+#define _OLDNLS32_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+	IMP APIs and structures (winnls32.h)
+*/
+
+typedef struct _tagDATETIME {
+	WORD	year;
+	WORD	month;
+	WORD	day;
+	WORD	hour;
+	WORD	min;
+	WORD	sec;
+} DATETIME;
+
+typedef struct _tagIMEPROA {
+	HWND		hWnd;
+	DATETIME	InstDate;
+	UINT		wVersion;
+	BYTE		szDescription[50];
+	BYTE		szName[80];
+	BYTE		szOptions[30];
+#if defined(TAIWAN)
+	BYTE		szUsrFontName[80];
+	BOOL		fEnable;
+#endif
+} IMEPROA;
+
+typedef struct _tagIMEPROW {
+	HWND		hWnd;
+	DATETIME	InstDate;
+	UINT		wVersion;
+	WCHAR		szDescription[50];
+	WCHAR		szName[80];
+	WCHAR		szOptions[30];
+#if defined(TAIWAN)
+	WCHAR		szUsrFontName[80];
+	BOOL		fEnable;
+#endif
+} IMEPROW;
+
+typedef IMEPROA		*PIMEPROA, *LPIMEPROA;
+typedef IMEPROW		*PIMEPROW, *LPIMEPROW;
+
+
+BOOL WINAPI IMPGetIMEA(HWND, LPIMEPROA);
+BOOL WINAPI IMPGetIMEW(HWND, LPIMEPROW);
+BOOL WINAPI IMPQueryIMEA(LPIMEPROA);
+BOOL WINAPI IMPQueryIMEW(LPIMEPROW);
+BOOL WINAPI IMPSetIMEA(HWND, LPIMEPROA);
+BOOL WINAPI IMPSetIMEW(HWND, LPIMEPROW);
+
+
+#ifdef UNICODE
+typedef IMEPROW		IMEPRO;
+typedef PIMEPROW	PIMEPRO;
+typedef LPIMEPROW	LPIMEPRO;
+#define IMPGetIME	IMPGetIMEW
+#define IMPQueryIME	IMPQueryIMEW
+#define IMPSetIME	IMPSetIMEW
+#else
+typedef IMEPROA		IMEPRO;
+typedef PIMEPROA	PIMEPRO;
+typedef LPIMEPROA	LPIMEPRO;
+#define IMPGetIME	IMPGetIMEA
+#define IMPQueryIME	IMPQueryIMEA
+#define IMPSetIME	IMPSetIMEA
+#endif
+
+/*
+	IMM APIs (winnls32.h)
+*/
+
+UINT WINAPI WINNLSGetIMEHotkey(HWND);
+BOOL WINAPI WINNLSEnableIME(HWND, BOOL);
+BOOL WINAPI WINNLSGetEnableStatus(HWND);
+
+
+/*
+	IME APIs (ime.h)
+*/
+
+#if !defined(SendIMEMessageEx)
+LRESULT WINAPI SendIMEMessageExA(HWND, LPARAM);
+LRESULT WINAPI SendIMEMessageExW(HWND, LPARAM);
+#ifdef UNICODE
+#define SendIMEMessageEx	SendIMEMessageExW
+#else
+#define SendIMEMessageEx	SendIMEMessageExA
+#endif
+#endif	/* !defined(SendIMEMessageEx) */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OLDNLS32_ */
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 5494)
+++ trunk/src/user32/win32wbase.cpp	(revision 5496)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.249 2001-04-02 17:30:58 sandervl Exp $ */
+/* $Id: win32wbase.cpp,v 1.250 2001-04-12 14:04:32 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -109,5 +109,4 @@
   windowNameA      = NULL;
   windowNameW      = NULL;
-  wndNameLength    = 0;
 
   userWindowBytes  = NULL;;
@@ -545,5 +544,5 @@
         if (!isUnicode)
         {
-            wndNameLength = strlen(cs->lpszName);
+            int wndNameLength = strlen(cs->lpszName);
             windowNameA = (LPSTR)_smalloc(wndNameLength+1);
             strcpy(windowNameA,cs->lpszName);
@@ -555,11 +554,21 @@
         else
         {
-            wndNameLength = lstrlenW((LPWSTR)cs->lpszName);
-            windowNameA = (LPSTR)_smalloc(wndNameLength+1);
-            lstrcpyWtoA(windowNameA,(LPWSTR)cs->lpszName);
+            // Wide
+            int wndNameLength = lstrlenW((LPWSTR)cs->lpszName);
             windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR));
             lstrcpyW(windowNameW,(LPWSTR)cs->lpszName);
-            windowNameA[wndNameLength] = 0;
-            windowNameW[wndNameLength] = 0;
+            windowNameW[lstrlenW((LPWSTR)cs->lpszName)] = 0; // need ?
+            // Ascii
+            LPSTR tmp = HEAP_strdupWtoA(GetProcessHeap(), 0, (LPWSTR)cs->lpszName);
+            if(tmp) {
+                long tmpLength = strlen( tmp );
+                windowNameA = (LPSTR)_smalloc(tmpLength+1);
+                strcpy(windowNameA,tmp);
+                windowNameA[tmpLength] = 0; // need ?
+                HEAP_free(tmp);
+            } else {
+                windowNameA = (LPSTR)_smalloc(1);
+                windowNameA[0] = 0;
+            }
         }
     }
@@ -1380,5 +1389,10 @@
 
     case WM_GETTEXTLENGTH:
-        return wndNameLength;
+        if(windowNameA) {
+          return strlen(windowNameA);
+        }
+        else {
+          return 0;
+        }
 
     case WM_GETTEXT:
@@ -1386,5 +1400,5 @@
         if (!windowNameA) ((LPSTR)lParam)[0] = 0;
         else lstrcpynA((LPSTR)lParam, windowNameA, wParam);
-        return min(wndNameLength, wParam);
+        return min((windowNameA ? strlen(windowNameA) : 0), wParam);
 
     case WM_SETTEXT:
@@ -1396,5 +1410,5 @@
         if (lParam)
         {
-            wndNameLength = strlen(lpsz);
+            int wndNameLength = strlen(lpsz);
             windowNameA = (LPSTR)_smalloc(wndNameLength+1);
             strcpy(windowNameA, lpsz);
@@ -1406,5 +1420,4 @@
             windowNameA = NULL;
             windowNameW = NULL;
-            wndNameLength = 0;
         }
         dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam));
@@ -1689,24 +1702,28 @@
         sibling = GetWindow (GW_HWNDFIRST);
         while (sibling != 0) {
-          siblingWindow = GetWindowFromHandle (sibling);
-          nameLength = siblingWindow->GetWindowTextA (nameBuffer, 40);
-
-          // find the siblings mnemonic
-          mnemonic = '\0';
-          for (int i=0 ; i<nameLength ; i++) {
-            if (nameBuffer [i] == '&') {
-              mnemonic = nameBuffer [i+1];
-              if ((mnemonic >= 'a') && (mnemonic <= 'z'))
-                mnemonic -= 32; // make it uppercase
-              break;  // stop searching
+            siblingWindow = GetWindowFromHandle (sibling);
+            nameLength = siblingWindow->GetWindowTextA (nameBuffer, 40);
+
+            // find the siblings mnemonic
+            mnemonic = '\0';
+            for (int i=0 ; i<nameLength ; i++) {
+                if (IsDBCSLeadByte(nameBuffer[i])) {
+                    // Skip DBCS
+                    continue;
+                }
+                if (nameBuffer [i] == '&') {
+                    mnemonic = nameBuffer [i+1];
+                    if ((mnemonic >= 'a') && (mnemonic <= 'z'))
+                        mnemonic -= 32; // make it uppercase
+                    break;  // stop searching
+                }
             }
-          }
-
-          // key matches siblings mnemonic, send mouseclick
-          if (mnemonic == (char) wParam) {
-            siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);
-          }
-
-          sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
+
+            // key matches siblings mnemonic, send mouseclick
+            if (mnemonic == (char) wParam) {
+                siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);
+            }
+
+            sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
         }
 
@@ -1845,5 +1862,8 @@
     {
     case WM_GETTEXTLENGTH:
-        return wndNameLength;
+        if(windowNameW) {
+             return lstrlenW(windowNameW);
+        }
+        else return 0;
 
     case WM_GETTEXT:
@@ -1851,5 +1871,5 @@
         if (!windowNameW) ((LPWSTR)lParam)[0] = 0;
         else lstrcpynW((LPWSTR)lParam,windowNameW,wParam);
-        return min(wndNameLength,wParam);
+        return min((windowNameW ? lstrlenW(windowNameW) : 0),wParam);
 
     case WM_SETTEXT:
@@ -1861,15 +1881,26 @@
         if (lParam)
         {
-          wndNameLength = lstrlenW(lpsz);
-          windowNameA = (LPSTR)_smalloc(wndNameLength+1);
-          lstrcpyWtoA(windowNameA,lpsz);
-          windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR));
-          lstrcpyW(windowNameW,lpsz);
+            // Wide
+            int wndNameLength = lstrlenW(lpsz);
+            windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR));
+            lstrcpyW(windowNameW,lpsz);
+            // Ascii
+            LPSTR tmp = HEAP_strdupWtoA(GetProcessHeap(), 0, lpsz);
+            if(tmp) {
+                long tmpLength = strlen( tmp );
+                windowNameA = (LPSTR)_smalloc(tmpLength+1);
+                strcpy(windowNameA,tmp);
+                windowNameA[tmpLength] = 0; // need ?
+                HEAP_free(tmp);
+            }
+            else {
+                windowNameA = (LPSTR)_smalloc(1);
+                windowNameA[0] = 0;
+            }
         }
         else
         {
-          windowNameA = NULL;
-          windowNameW = NULL;
-          wndNameLength = 0;
+            windowNameA = NULL;
+            windowNameW = NULL;
         }
         dprintf(("WM_SETTEXT of %x\n",Win32Hwnd));
@@ -2298,5 +2329,5 @@
 //testestest
     //temporary workaround for file dialogs with template dialog child
-    //they don't redraw when switching directories 
+    //they don't redraw when switching directories
     //For some reason the new child's (syslistview32) update rectangle stays
     //empty after its parent is made visible with ShowWindow
@@ -3238,25 +3269,26 @@
 BOOL Win32BaseWindow::hasWindowName(LPSTR wndname, BOOL fUnicode)
 {
-    INT len = GetWindowTextLength();
+    INT len = GetWindowTextLength(fUnicode);
     BOOL res;
 
     if (wndname == NULL)
-      return (len == 0);
+        return (len == 0);
 
     len++;
     if (fUnicode)
     {
-      WCHAR *text = (WCHAR*)malloc(len*sizeof(WCHAR));
-
-      GetWindowTextW(text,len);
-      res = (lstrcmpW(text,(LPWSTR)wndname) == 0);
-      free(text);
-    } else
-    {
-      CHAR *text = (CHAR*)malloc(len*sizeof(CHAR));
-
-      GetWindowTextA(text,len);
-      res = (strcmp(text,wndname) == 0);
-      free(text);
+        WCHAR *text = (WCHAR*)malloc(len*sizeof(WCHAR));
+
+        GetWindowTextW(text,len);
+        res = (lstrcmpW(text,(LPWSTR)wndname) == 0);
+        free(text);
+    }
+    else
+    {
+        CHAR *text = (CHAR*)malloc(len*sizeof(CHAR));
+
+        GetWindowTextA(text,len);
+        res = (strcmp(text,wndname) == 0);
+        free(text);
     }
 
@@ -3267,5 +3299,5 @@
 CHAR *Win32BaseWindow::getWindowNamePtrA()
 {
-    INT len = GetWindowTextLength();
+    INT len = GetWindowTextLength(FALSE);
     CHAR *text;
 
@@ -3281,5 +3313,5 @@
 WCHAR *Win32BaseWindow::getWindowNamePtrW()
 {
-    INT len = GetWindowTextLength();
+    INT len = GetWindowTextLength(TRUE);
     WCHAR *text;
 
@@ -3301,12 +3333,27 @@
 //does NOT send WM_GETTEXTLENGTH.
 //******************************************************************************
-int Win32BaseWindow::GetWindowTextLength()
+int Win32BaseWindow::GetWindowTextLength(BOOL fUnicode)
 {
     //if the destination window is created by this process, send message
     if(dwProcessId == currentProcessId) {
-        return SendInternalMessageA(WM_GETTEXTLENGTH,0,0);
+        if(fUnicode) {
+             return SendInternalMessageW(WM_GETTEXTLENGTH,0,0);
+        }
+        else return SendInternalMessageA(WM_GETTEXTLENGTH,0,0);
     }
     //else get data directory from window structure
-    return wndNameLength;
+    //TODO: must lock window structure.... (TODO)
+    if(fUnicode) {
+        if(windowNameW) {
+             return strlenW(windowNameW);
+        }
+        else return 0;
+    }
+    else {
+        if(windowNameA) {
+             return strlen(windowNameA);
+        }
+        else return 0;
+    }
 }
 //******************************************************************************
@@ -3324,5 +3371,5 @@
     if (!windowNameA) lpsz[0] = 0;
     else lstrcpynA(lpsz, windowNameA, cch);
-    return min(wndNameLength, cch);
+    return min((windowNameA ? strlen(windowNameA) : 0), cch);
 }
 //******************************************************************************
@@ -3340,5 +3387,5 @@
     if (!windowNameW) lpsz[0] = 0;
     else lstrcpynW(lpsz, windowNameW, cch);
-    return min(wndNameLength, cch);
+    return min((windowNameW ? strlenW(windowNameW) : 0), cch);
 }
 //******************************************************************************
Index: trunk/src/user32/win32wbase.h
===================================================================
--- trunk/src/user32/win32wbase.h	(revision 5494)
+++ trunk/src/user32/win32wbase.h	(revision 5496)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.112 2001-03-30 11:14:36 sandervl Exp $ */
+/* $Id: win32wbase.h,v 1.113 2001-04-12 14:04:33 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -261,5 +261,8 @@
          BOOL   IsMixMaxStateChanging()       { return fMinMaxChange; };
 
-         int    GetWindowTextLength();
+         int    GetWindowTextLength(BOOL fUnicode);
+         int    GetWindowTextLengthA() { return GetWindowTextLength(FALSE); };
+         int    GetWindowTextLengthW() { return GetWindowTextLength(TRUE);  };
+
          int    GetWindowTextA(LPSTR lpsz, int cch);
          int    GetWindowTextW(LPWSTR lpsz, int cch);
@@ -389,5 +392,4 @@
         char   *windowNameA;
         WCHAR  *windowNameW;
-        ULONG   wndNameLength; //including 0 terminator
 
         char   *userWindowBytes;
Index: trunk/src/user32/windlgmsg.cpp
===================================================================
--- trunk/src/user32/windlgmsg.cpp	(revision 5494)
+++ trunk/src/user32/windlgmsg.cpp	(revision 5496)
@@ -1,3 +1,3 @@
-/* $Id: windlgmsg.cpp,v 1.7 2000-03-18 16:13:41 cbratschi Exp $ */
+/* $Id: windlgmsg.cpp,v 1.8 2001-04-12 14:04:33 sandervl Exp $ */
 /*
  * Win32 dialog message APIs for OS/2
@@ -93,5 +93,5 @@
               if (dlgCode & (DLGC_BUTTON | DLGC_STATIC))
               {
-                INT textLen = win32wnd->GetWindowTextLength();
+                INT textLen = win32wnd->GetWindowTextLengthA();
 
                 if (textLen > 0)
Index: trunk/src/user32/window.cpp
===================================================================
--- trunk/src/user32/window.cpp	(revision 5494)
+++ trunk/src/user32/window.cpp	(revision 5496)
@@ -1,3 +1,3 @@
-/* $Id: window.cpp,v 1.92 2001-03-30 23:59:47 sandervl Exp $ */
+/* $Id: window.cpp,v 1.93 2001-04-12 14:04:33 sandervl Exp $ */
 /*
  * Win32 window apis for OS/2
@@ -798,10 +798,10 @@
     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
-        dprintf(("GetWindowTextLength, window %x not found", hwnd));
-        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
-        return 0;
-    }
-    dprintf(("GetWindowTextLength %x", hwnd));
-    return window->GetWindowTextLength();
+        dprintf(("GetWindowTextLengthA, window %x not found", hwnd));
+        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
+        return 0;
+    }
+    dprintf(("GetWindowTextLengthA %x", hwnd));
+    return window->GetWindowTextLengthA();
 }
 //******************************************************************************
@@ -826,6 +826,14 @@
 int WIN32API GetWindowTextLengthW( HWND hwnd)
 {
-    dprintf(("USER32:  GetWindowTextLengthW\n"));
-    return GetWindowTextLengthA(hwnd);
+   Win32BaseWindow *window;
+
+    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("GetWindowTextLengthW, window %x not found", hwnd));
+        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
+        return 0;
+    }
+    dprintf(("GetWindowTextLengthW %x", hwnd));
+    return window->GetWindowTextLengthW();
 }
 //******************************************************************************
