diff options
Diffstat (limited to 'win/tkWinTest.c')
-rw-r--r-- | win/tkWinTest.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/win/tkWinTest.c b/win/tkWinTest.c index d824ee4..6e79df3 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -515,6 +515,7 @@ TestgetwindowinfoObjCmd( Tcl_Obj *childrenObj = NULL; TCHAR buf[512]; int cch, cchBuf = 256; + Tcl_DString ds; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "hwnd"); @@ -542,7 +543,9 @@ TestgetwindowinfoObjCmd( Tcl_NewLongObj(GetWindowLongA(INT2PTR(hwnd), GWL_ID))); cch = GetWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf); - textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch); + Tcl_WinTCharToUtf(buf, cch * sizeof (WCHAR), &ds); + textObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); + Tcl_DStringFree(&ds); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("text", 4), textObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("parent", 6), |