diff options
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index e680145..6551081 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.94 2005/01/16 00:23:13 chengyemao Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.95 2005/01/31 04:08:32 chengyemao Exp $ */ #include "tkWinInt.h" @@ -4958,9 +4958,13 @@ WmTitleCmd(tkwin, winPtr, interp, objc, objv) } if (objc == 3) { if(wrapper) { - char buf[256]; - GetWindowText(wrapper, buf, 256); - Tcl_SetResult(interp, buf, TCL_VOLATILE); + char buf[512]; + Tcl_DString titleString; + int size = tkWinProcs->useWide? 256:512; + (*tkWinProcs->getWindowText)(wrapper, (LPCTSTR)buf, size); + Tcl_WinTCharToUtf(buf, -1, &titleString); + Tcl_SetResult(interp, Tcl_DStringValue(&titleString), TCL_VOLATILE); + Tcl_DStringFree(&titleString); } else { Tcl_SetResult(interp, (char *) ((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid), |