procedure TfDokAnzeige.trackZoomChange(Sender: TObject);
var
ZoomFac : OLEVariant;
const
OLECMDID_OPTICAL_ZOOM = 63;
begin
timer1.Enabled := False;
lbZoom.Caption := '
Zoom ' + IntToStr(trackZoom.Position) + '
%';
try
If trackZoom.Position = WebBrowser1.OleObject.Document.ParentWindow.Screen.deviceXDPI * 100 / WebBrowser1.OleObject.Document.ParentWindow.Screen.logicalXDPI
then
begin
panZoom.Visible := True;
timer1.Enabled := True;
Exit;
end;
except
end;
try
ZoomFac := trackZoom.Position;
WebBrowser1.ExecWB(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, ZoomFac);
panZoom.Visible := True;
timer1.Enabled := True;
except
panZoom.Visible := False;
end;
end;
procedure TfDokAnzeige.WebBrowser1DocumentComplete(ASender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
begin
trackZoomChange(trackZoom);
end;
procedure TfDokAnzeige.Timer1Timer(Sender: TObject);
begin
try
trackZoom.Position := WebBrowser1.OleObject.Document.ParentWindow.Screen.deviceXDPI * 100 / WebBrowser1.OleObject.Document.ParentWindow.Screen.logicalXDPI;
except
end;
end;