diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-24 11:49:30 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-24 11:49:30 (GMT) |
commit | 14ffbbfd3279791bcc99fd50066d6821e92cc5f9 (patch) | |
tree | 633a1c584b40b8c557a2c7ee10b6db57966d271f /win/tkWinWm.c | |
parent | aeb98f3a5488e637486a6b376b172de8a658d4b9 (diff) | |
download | tk-14ffbbfd3279791bcc99fd50066d6821e92cc5f9.zip tk-14ffbbfd3279791bcc99fd50066d6821e92cc5f9.tar.gz tk-14ffbbfd3279791bcc99fd50066d6821e92cc5f9.tar.bz2 |
Allow "wm frame" to return id's > 0xFFFFFFFF on 64-bit platforms (if the id really is that large). Backport the (internal) use of TCL_Z_MODIFIER from Tk 8.7.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 8b3e449..dcafd68 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -3711,6 +3711,7 @@ WmFrameCmd( { register WmInfo *wmPtr = winPtr->wmInfoPtr; HWND hwnd; + char buf[TCL_INTEGER_SPACE]; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -3723,7 +3724,8 @@ WmFrameCmd( if (hwnd == NULL) { hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr)); } - Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", PTR2INT(hwnd))); + sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)hwnd); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); return TCL_OK; } @@ -5466,7 +5468,7 @@ WmTitleCmd( int size = 256; GetWindowTextW(wrapper, buf, size); - Tcl_WinTCharToUtf(buf, -1, &titleString); + Tcl_WinTCharToUtf((LPCTSTR)buf, -1, &titleString); Tcl_SetObjResult(interp, Tcl_NewStringObj( Tcl_DStringValue(&titleString), Tcl_DStringLength(&titleString))); |