|
Purpose |
Allows subclassing of all or individual control classes used by the 4.600 terminal manager |
|||
|
Syntax |
long pascal trm_control_subclass(int type,long NewWndProc) |
|||
|
Parameters |
int type |
See Description below |
||
|
|
long NewWndProc |
See Description below |
||
|
Description |
In 4.500 the only window created by DP4 is the window returned by trm_get_hwnd(). In 4.600, however, every control in every map is a separate window. Consequently subclassing terminal manager windows has to be handled differently. The function trm_control_subclass() allows subclassing of all or individual control classes used by the 4.600 terminal manager. The types of control are listed in MAPS.H, namely the defines from CT_EDIT to CT_VCR. Note that CT_ICON and CT_BITMAP use the same Windows class, as do all the classes CT_CHECKBOX to CT_VCR. There are two ways to use this function:
When subclassing a single control type, the return value is the previous window function for the class. This value can be used to pass on messages to the old window function through CallWindowProc(). When subclassing all types of control, the return value must be ignored. To pass on a call to the previous window function, use GetClassLong() as follows:
See the Example program below. Note that when trm_control_subclass() is used in this way, calls to it cannot be nested successfully. The return value from GetClassLong(0) is set when trm_control_subclass() is first called and is not changed by subsequent calls to the function. Calling trm_control_subclass(0,NewWndProc) does not subclass the main window of the application. To subclass this window, proceed as follows:
As a convenience to programmers GetClassLong(hWnd, 0) also returns the original Window function for the window, allowing one Window function to subclass all windows created by the terminal manager. Please note the following two very important points concerning trm_subclass():
|
|||
|
Return values |
See Description above |
|||
|
Example |
|
|||