5,379
社区成员
发帖
与我相关
我的任务
分享
var
originProc : TWndMethod;
procedure TForm1.btn1Click(Sender: TObject);
//var
//newProc : TWndMethod;
begin
//newProc := NewWindowProc;
SetWindowLong(pnl1.Handle, GWL_EXSTYLE, GetWindowLong(pnl1.Handle, GWL_EXSTYLE) or WS_EX_TRANSPARENT);
originProc := pnl1.WindowProc;
pnl1.WindowProc := NewWindowProc;
//SetWindowLong(pnl1.handle, GWL_WNDPROC, Integer(@newProc));
RecreateWnd;
end;
procedure TForm1.NewWindowProc(var Message: TMessage);
begin
if Message.Msg = WM_ERASEBKGND then
Message.result := 1
else
//CallWindowProc(@originProc,pnl1.Handle, Message.Msg, Message.WParam, Message.LParam);
originProc(Message);
end;