Method WndUtil.Subclass
Overload
Subclasses a window.
public static object Subclass(wnd w, WNDPROC proc)
Parameters
w (wnd)
A window or control of this thread. |
proc (WNDPROC)
The new window procedure. It is called on every message received by the window (unless blocked by another subclass added later). Let it call WndUtil.DefSubclassProc, except when you want to block the message. |
Returns
object
A cookie for WndUtil.Unsubclass. Returns |
Remarks
Uses API SetWindowSubclass. Implicitly unsubclasses when the window is destroyed. Protects proc from GC for as long as need.