大家我看看有什么错,是关于杀广告窗体的?
laoli 2002-08-04 03:05:38 procedure TForm1.Timer1Timer(Sender: TObject);
var
mainHD,WorkAHD,ViewHD:THandle;
y_workA,y_view:integer;
rect1,rect2:TRect;
begin
// Kill AD.
mainHD:=FindWIndowEx(0,0,'CabinetWClass',nil);
if Mainhd<>0 then
begin
WorkAHD:=FindWindowEx(Mainhd,0,'WorkerA',nil);
GetwindowRect(WorkAHD,rect1);
y_workA:=rect1.top;
ViewHD:=FindWindowEx(mainHD,0,'Shell DocObject View',nil);
if viewHD<>0 then ////注1:
begin
GetwindowRect(ViewHD,rect2);
y_view:=rect2.top;
if y_View-y_WorkA<5 then PostMessage(Mainhd,WM_CLOSE,0,0);
end;
end;
end;