summaryrefslogtreecommitdiffstats
path: root/win/tkWinScrlbr.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/tkWinScrlbr.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/tkWinScrlbr.c')
-rw-r--r--win/tkWinScrlbr.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index a6bb09a..1a9cbc9 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinScrlbr.c,v 1.5 2000/03/31 09:24:27 hobbs Exp $
+ * RCS: @(#) $Id: tkWinScrlbr.c,v 1.6 2000/11/03 01:22:17 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -249,8 +249,13 @@ CreateProc(tkwin, parentWin, instanceData)
}
scrollPtr->lastVertical = scrollPtr->info.vertical;
+#ifdef _WIN64
+ scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd,
+ GWLP_WNDPROC, (LONG_PTR) ScrollbarProc);
+#else
scrollPtr->oldProc = (WNDPROC)SetWindowLong(scrollPtr->hwnd, GWL_WNDPROC,
(DWORD) ScrollbarProc);
+#endif
window = Tk_AttachHWND(tkwin, scrollPtr->hwnd);
UpdateScrollbar(scrollPtr);
@@ -295,7 +300,11 @@ TkpDisplayScrollbar(clientData)
if (scrollPtr->lastVertical != scrollPtr->info.vertical) {
HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin));
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc);
+#else
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) scrollPtr->oldProc);
+#endif
DestroyWindow(hwnd);
CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)),
@@ -328,7 +337,11 @@ TkpDestroyScrollbar(scrollPtr)
WinScrollbar *winScrollPtr = (WinScrollbar *)scrollPtr;
HWND hwnd = winScrollPtr->hwnd;
if (hwnd) {
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winScrollPtr->oldProc);
+#else
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) winScrollPtr->oldProc);
+#endif
if (winScrollPtr->winFlags & IN_MODAL_LOOP) {
((TkWindow *)scrollPtr->tkwin)->flags |= TK_DONT_DESTROY_WINDOW;
SetParent(hwnd, NULL);