diff options
Diffstat (limited to 'win/tkWinScrlbr.c')
-rw-r--r-- | win/tkWinScrlbr.c | 15 |
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); |