program Project1;
uses
Forms,
Unit1 in 'UNIT1.PAS' { Form1 },
Messages, WinTypes, WinProcs,
{$R *.RES}
var
OldWndProc: TFarProc;
function NewWndProc(hWndAppl: HWnd; Msg, wParam: Word; lParam: Longint):
Longint; export;
begin
{ default WndProc return value }
Result := 0;
{ handle messages here; the message number is in Msg }
Result := CallWindowProc(OldWndProc, hWndAppl, Msg, wParam, lParam);
end;
begin
Application.CreateForm(TForm1, Form1);
OldWndProc := TFarProc(GetWindowLong(Application.Handle, GWL_WNDPROC));
SetWindowLong(Application.Handle, GWL_WNDPROC, Longint(@NewWndProc));
Application.Run;
end.
|