先建立一个自己的窗口过程,在其中处理消息,如:
function newwndProc(handle:hWind;Msg,wParam,lParam:LongInt):LongInt;stdcall;
begin
if Msg=WM_... then ...;
result:=callwindowProc(Wproc,handle,Msg,wParam,lParam);
end;然后用SetWindowLong()函数来给一个应用程序窗口指定新的窗口过程,也就是上面这个过程。
function newwndProc(handle:hWind;Msg,wParam,lParam:LongInt):LongInt;stdcall;
begin
if Msg=WM_... then ...;
result:=callwindowProc(Wproc,handle,Msg,wParam,lParam);
end;然后用SetWindowLong()函数来给一个应用程序窗口指定新的窗口过程,也就是上面这个过程。
var Wproc:pointer;
initialization
Wproc:=Pointer(SetWindowLong(Handle,gwl_wndProc,Integer(@newwndProc)));