Blog http://blog.9cbs.net/pankun/ of the sword god
Everyone knows that each window has the default window function to perform the processing of the window message. And the subclassics is the technology of the window function that replaces the window for its own function. For example, the following code: Var Form1: TFORM1; OldWndProc : Pointer; IMPLEMENTATION
{$ R * .dfm} function NewWndProc (hHwnd, Msg, wParam, lParam: LongWORD): Longint; stdcall; begin if Msg = WM_CLOSE then exit; Result: = CallWindowProc (OldWndProc, hHwnd, Msg, wParam, lParam); end ;
procedure TForm1.FormCreate (Sender: TObject); begin {Save the old window function address} OldWndProc: = Pointer (GetWindowLong (Self.Handle, GWL_WNDPROC)); {set a new window function for the custom function} SetWindowLong (Self.Handle GWL_WNDPROC