5 * DEFINITIONS ________________________________________________________________
15 * PROTOTYPES _________________________________________________________________
17 * These routines provide a consistent method for multiple children in
18 * a dialog to add and remove subclasses, without stepping on each
23 * // Install subclass on create
24 * LONG oldProc = GetWindowLong (hWnd, GWL_WNDPROC);
25 * SetWindowLong (hWnd, GWL_WNDPROC, (LONG)MyWindowProc);
29 * CallWindowProc(oldProc,hWnd,msg,wp,lp);
31 * DefWindowProc(hWnd,msg,wp,lp);
33 * // Uninstall subclass on destroy
34 * SetWindowLong (hWnd, GWL_WNDPROC, (LONG)oldProc);
36 * Will eat itself unless all changes are peeled back in the opposite
37 * order in which subclasses were installed. This technique won't:
39 * // Install subclass on create
40 * Subclass_AddHook (hWnd, MyWindowProc);
43 * PVOID oldProc = Subclass_FindNextHook (hWnd, MyWindowProc);
45 * CallWindowProc(oldProc,hWnd,msg,wp,lp);
47 * DefWindowProc(hWnd,msg,wp,lp);
49 * // Uninstall subclass on destroy
50 * Subclass_RemoveHook (hWnd, MyWindowProc);
52 * Note that if five calls are made to add "Subclass_AddHook" giving
53 * the same hTarget and wndProc, then five successive calls to _Remove
54 * will be necessary to remove the hook; also note that the wndProc
55 * will (of course) be called only *once* per message.
59 EXPORTED BOOL Subclass_AddHook (HWND hTarget, PVOID wndProc);
60 EXPORTED void Subclass_RemoveHook (HWND hTarget, PVOID wndProc);
61 EXPORTED PVOID Subclass_FindNextHook (HWND hTarget, PVOID wndProcMine);