说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

拦截消息处理过程-Delphi资料

HTML文档下载 WORD文档下载 PDF文档下载
拦截消息处理过程-Delphi资料

program Project1;

uses

Forms

messages

wintypes

winprocs

Unit1 in 'UNIT1.PAS' {Form1};

{$R *.RES}

var

OldWndProc: TFarProc;

function NewWndProc(hWndAppl: HWnd; Msg

wParam: Word;

lParam: Longint): Longint; export;

begin

NewWndProc := 0; { Default WndProc return value }

NewWndProc := 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.

备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘