|
|
1.1 root 1: Sample: SUBCLASS Program Demonstration
2:
3: Summary:
4:
5: The SUBCLASS sample demonstrates how a program can subclass
6: standard controls in order to extend their normal
7: functionality. This sample replaces the window procedure for
8: buttons, edit fields, and list boxes.
9:
10: More Information:
11:
12: The standard subclassing technique is to replace the window
13: procedure in the window structure by using:
14:
1.1.1.2 ! root 15: SetWindowLong (hwnd, GWL_WNDPROC, (LONG) SubclassWndProc);
1.1 root 16:
17: In the SUBCLASS sample, the old window procedure is also
18: saved in a structure pointed at by the user data. Thus, any
19: functionality can be added to various classes of windows
20: without having to know what the class originally was.
21:
22: In this sample, the subclass procedure adds the ability to
23: move and size the control windows when the application is
24: not in "test mode." When the application is in test mode,
25: the subclass procedure calls the original window procedure
26: and the controls behave as normal. Thus, this sample
27: provides the bare bones for a "dialog editor" type of
28: program.
29:
1.1.1.2 ! root 30: Additional reference words: CallWindowProc
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.