summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-11-03 01:22:16 (GMT)
committerhobbs <hobbs>2000-11-03 01:22:16 (GMT)
commit788680db0e6198c631a5b63066a21e6749cad38b (patch)
treea0b9272393eee9e4aaf17c795e92a28278d20b8c /win/tkWinWm.c
parentbd04e28031219d0fe2d9b5040d17ba7f1220bca5 (diff)
downloadtk-788680db0e6198c631a5b63066a21e6749cad38b.zip
tk-788680db0e6198c631a5b63066a21e6749cad38b.tar.gz
tk-788680db0e6198c631a5b63066a21e6749cad38b.tar.bz2
* win/tkWinButton.c:
* win/tkWinDialog.c: * win/tkWinScrlbr.c: * win/tkWinWm.c: fixed up code for Win64 support. This mostly remains in _WIN64 #ifdef's, until updated compilers are standard.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index fdfc4cf..bb2ad54 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.26 2000/07/06 03:17:45 mo Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.27 2000/11/03 01:22:17 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -406,7 +406,11 @@ GetTopLevel(hwnd)
if (tsdPtr->createWindow) {
return tsdPtr->createWindow;
}
+#ifdef _WIN64
+ return (TkWindow *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#else
return (TkWindow *) GetWindowLong(hwnd, GWL_USERDATA);
+#endif
}
/*
@@ -755,7 +759,11 @@ UpdateWrapper(winPtr)
Tcl_DStringValue(&titleString), wmPtr->style, x, y, width,
height, parentHWND, NULL, Tk_GetHINSTANCE(), NULL);
Tcl_DStringFree(&titleString);
+#ifdef _WIN64
+ SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr);
+#else
SetWindowLong(wmPtr->wrapper, GWL_USERDATA, (LONG) winPtr);
+#endif
tsdPtr->createWindow = NULL;
place.length = sizeof(WINDOWPLACEMENT);
@@ -772,15 +780,28 @@ UpdateWrapper(winPtr)
* Windows doesn't try to set the focus to the child window.
*/
+#ifdef _WIN64
+ SetWindowLongPtr(child, GWL_STYLE,
+ WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+#else
SetWindowLong(child, GWL_STYLE,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+#endif
if (winPtr->flags & TK_EMBEDDED) {
+#ifdef _WIN64
+ SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc);
+#else
SetWindowLong(child, GWL_WNDPROC, (LONG) TopLevelProc);
+#endif
}
oldWrapper = SetParent(child, wmPtr->wrapper);
if (oldWrapper && (oldWrapper != wmPtr->wrapper)
&& (oldWrapper != GetDesktopWindow())) {
+#ifdef _WIN64
+ SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG) NULL);
+#else
SetWindowLong(oldWrapper, GWL_USERDATA, (LONG) NULL);
+#endif
if (wmPtr->numTransients > 0) {
/*
@@ -4198,7 +4219,7 @@ WmProc(hwnd, message, wParam, lParam)
LPARAM lParam;
{
static int inMoveSize = 0;
- static oldMode; /* This static is set upon entering move/size mode
+ static int oldMode; /* This static is set upon entering move/size mode
* and is used to reset the service mode after
* leaving move/size mode. Note that this mechanism
* assumes move/size is only one level deep. */