Scrolling windows/frames programatically

  • Thread starter Thread starter Thomas Nielsen [AM Production A/S]
  • Start date Start date
T

Thomas Nielsen [AM Production A/S]

Hi there,

I have placed an Internet Explorer ActiveX placed on form, and a range of
buttons that are used to control the behavior of the IE control (navigate to
other pages, etc).

I would now also like to scroll the contents of the IE ActiveX - Preferably
i would like to be able to scroll each frame independantly.

Up untill now, I've been able to scroll up/down by doing this:

mshtml.IHTMLDocument2 doc =
(mshtml.IHTMLDocument2)this.axWebBrowser1.control.GetDocument();
hm = (mshtml.HTMLWindow2Class)doc.frames.item(ref tst);
hm.scrollBy(0, ScrollSpeed);

This works flawlessly when all frames in a frameset are placed on the same
domain - But if they're not, i get the DHTML "access is denied" error, due
to IE security restrictions.

Is there any other way I would be able to scroll the frames within the
ActiveX control?

Thanks

Thomas
 
Hi thomas,

This issue is caused by the cross-frame security of Internet Explorer.
Since it's a security issue, I don't think there is an alternative to skip
the check.

You may try the workarounds suggested in the follow following WebCast and
KB article:
<PRB: Permission Denied Error Message When Scripting Across Frames>
http://support.microsoft.com/default.aspx?scid=kb;EN-US;167796
<325145 - Support WebCast: Cross-Frame Scripting Security in Internet
Explorer 4.0 and Later >
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc0403
01/wcblurb040301.asp

If you have anything unclear , please feel free to reply this thread.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top