strange values of Document.Window.Size in WebBrowser after optical_zoom command -
07-10-2009
, 02:33 AM
Hi all,
i use the .net 2.0 WebBrowser with c#.
Calling the command
_axIWebBrowser2.ExecWB(
NativeMethods.OLECMDID.OLECMDID_OPTICAL_ZOOM,
NativeMethods.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROM PTUSER,
ref setZoomFactor,
ref getZoomFaktor );
where _axIWebBrowser2 is the com-object in the webbrowser.
I get it with
protected override void AttachInterfaces(object nativeActiveXObject)
{
_axIWebBrowser2 = (UnsafeNativeMethods.IWebBrowser2)nativeActiveXObj ect;
base.AttachInterfaces(nativeActiveXObject);
}
ok, so far so good, but after the execWB-command to zoom the size property
of
WebBrowser.Document.Window holds values I dont understand.
First of all, the value becomes smaler and sometimes greater.
I cant find any logic of increaseing or decreasing of the Size - property
values.
I've tried several ways to get the height e.g.
IHTMLDocument2 pDoc2 = Browser.AxIWebBrowser.Document as IHTMLDocument2;
IHTMLElement pElem = pDoc2.body;
IHTMLElement2 pBodyElem = pElem as IHTMLElement2;
int bodyWidth = pBodyElem.scrollWidth;
int bodyHeight = pBodyElem.scrollHeight;
btw.
int scrollTop = pBodyElem.scrollTop is always 0.
I need this values, because I scroll the document manually and therefore i
need the maxsize of the Document.Window.Size.
Anybody here who knows the logic of the Size value changing or knows a way
to get the correct values of the Document.Window.Size after zooming
thx in advanced
regards
Wolfgang
ps. may be this is the wrong newsgroup, if so please give me a hint which
one is the right one! |