2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 * DEFINITIONS ________________________________________________________________
24 * PROTOTYPES _________________________________________________________________
26 * These routines provide a consistent method for multiple children in
27 * a dialog to add and remove subclasses, without stepping on each
32 * // Install subclass on create
33 * LONG oldProc = GetWindowLong (hWnd, GWL_WNDPROC);
34 * SetWindowLong (hWnd, GWL_WNDPROC, (LONG)MyWindowProc);
38 * CallWindowProc(oldProc,hWnd,msg,wp,lp);
40 * DefWindowProc(hWnd,msg,wp,lp);
42 * // Uninstall subclass on destroy
43 * SetWindowLong (hWnd, GWL_WNDPROC, (LONG)oldProc);
45 * Will eat itself unless all changes are peeled back in the opposite
46 * order in which subclasses were installed. This technique won't:
48 * // Install subclass on create
49 * Subclass_AddHook (hWnd, MyWindowProc);
52 * PVOID oldProc = Subclass_FindNextHook (hWnd, MyWindowProc);
54 * CallWindowProc(oldProc,hWnd,msg,wp,lp);
56 * DefWindowProc(hWnd,msg,wp,lp);
58 * // Uninstall subclass on destroy
59 * Subclass_RemoveHook (hWnd, MyWindowProc);
61 * Note that if five calls are made to add "Subclass_AddHook" giving
62 * the same hTarget and wndProc, then five successive calls to _Remove
63 * will be necessary to remove the hook; also note that the wndProc
64 * will (of course) be called only *once* per message.
68 EXPORTED BOOL Subclass_AddHook (HWND hTarget, PVOID wndProc);
69 EXPORTED void Subclass_RemoveHook (HWND hTarget, PVOID wndProc);
70 EXPORTED PVOID Subclass_FindNextHook (HWND hTarget, PVOID wndProcMine);