2000下调试通过,只能在2000下起作用,98要改动一点: procedure TForm1.Timer1Timer(Sender: TObject); var mainHD,WorkAHD,ViewHD:THandle; y_workW,y_view:integer; rect1,rect2:TRect; begin mainHD:=FindWIndowEx(0,0,'IEFrame',nil); if Mainhd<>0 then begin WorkAHD:=FindWindowEx(Mainhd,0,'WorkerW',nil); if WorkAHD<>0 then begin GetwindowRect(WorkAHD,rect1); y_workW:=rect1.top; ViewHD:=FindWindowEx(mainHD,0,'Shell DocObject View',nil); //ViewHD:=FindWindowEx(mainHD,0,'msctls_statusbar32',nil); if viewHD<>0 then ////ע1: begin GetwindowRect(ViewHD,rect2); y_view:=rect2.top; caption:=inttostr(y_workw)+'---'+inttostr(y_view); if y_View-y_Workw<6 then PostMessage(Mainhd,WM_CLOSE,0,0); end; end; end;end;
欢迎交流
顺便帮你UP
[email protected]
procedure TForm1.Timer1Timer(Sender: TObject);
var
mainHD,WorkAHD,ViewHD:THandle;
y_workW,y_view:integer;
rect1,rect2:TRect;
begin mainHD:=FindWIndowEx(0,0,'IEFrame',nil);
if Mainhd<>0 then
begin
WorkAHD:=FindWindowEx(Mainhd,0,'WorkerW',nil);
if WorkAHD<>0 then
begin
GetwindowRect(WorkAHD,rect1);
y_workW:=rect1.top;
ViewHD:=FindWindowEx(mainHD,0,'Shell DocObject View',nil);
//ViewHD:=FindWindowEx(mainHD,0,'msctls_statusbar32',nil);
if viewHD<>0 then ////ע1:
begin
GetwindowRect(ViewHD,rect2);
y_view:=rect2.top;
caption:=inttostr(y_workw)+'---'+inttostr(y_view); if y_View-y_Workw<6 then PostMessage(Mainhd,WM_CLOSE,0,0);
end;
end;
end;end;