diff options
Diffstat (limited to 'win/tkWinEmbed.c')
-rw-r--r-- | win/tkWinEmbed.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 1a6ece3..43cd419 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -259,7 +259,7 @@ TkpUseWindow( if (Tcl_GetInt(interp, string, &id) != TCL_OK) { return TCL_ERROR; } - hwnd = (HWND) id; + hwnd = (HWND) INT2PTR(id); if ((HWND)winPtr->privatePtr == hwnd) { return TCL_OK; } @@ -279,12 +279,12 @@ TkpUseWindow( } id = SendMessage(hwnd, TK_INFO, TK_CONTAINER_VERIFY, 0); - if (id == (long)hwnd) { + if (id == PTR2INT(hwnd)) { if (!SendMessage(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { Tcl_AppendResult(interp, "The container is already in use", NULL); return TCL_ERROR; } - } else if (id == -(long)hwnd) { + } else if (id == -PTR2INT(hwnd)) { Tcl_AppendResult(interp, "the window to use is not a Tk container", NULL); return TCL_ERROR; @@ -457,7 +457,7 @@ TkWinEmbeddedEventProc( result = containerPtr->embeddedHWnd == NULL? 1:0; break; case TK_CONTAINER_VERIFY: - result = (long)containerPtr->parentHWnd; + result = PTR2INT(containerPtr->parentHWnd); break; default: result = 0; @@ -495,7 +495,7 @@ TkWinEmbeddedEventProc( } containerPtr->embeddedHWnd = (HWND)wParam; } - result = (long)containerPtr->parentHWnd; + result = PTR2INT(containerPtr->parentHWnd); } else { result = 0; } @@ -568,14 +568,14 @@ TkWinEmbeddedEventProc( * returned. */ if (topwinPtr) { - result = (long)GetParent(containerPtr->parentHWnd); + result = PTR2INT(GetParent(containerPtr->parentHWnd)); } else { topwinPtr = containerPtr->parentPtr; while (!(topwinPtr->flags & TK_TOP_HIERARCHY)) { topwinPtr = topwinPtr->parentPtr; } if (topwinPtr && topwinPtr->window) { - result = (long)GetParent(Tk_GetHWND(topwinPtr->window)); + result = PTR2INT(GetParent(Tk_GetHWND(topwinPtr->window))); } else { result = 0; } @@ -759,7 +759,7 @@ TkWinEmbeddedEventProc( * Reply the message sender: this is not a Tk container */ - return -(long)hwnd; + return -PTR2INT(hwnd); } else { result = 0; } |