Jump to content
Sign in to follow this  
zhaicheng

How to get the position of the scrollbar in the page

Recommended Posts

zhaicheng

How to get the position of the scrollbar in the page

Hello,every one.

I use _IECreate" to create an Internet Explorer Browser Window,and I send a few "{PGDN}" to the control.

Now my question is how can I know that the scrollbar has reached the bottom of the page?

Can you give me some advice?

Thank you!

Share this post


Link to post
Share on other sites
kylomas

zhaicheng,

I don't know if the IE object has a method for getting to the bottom of the page or not. If it does then you should use that method. However, a workaround could be to write the source from the page to a temp file and process the source, kludgy, but works.

See help files for "inetget" and "_inetgetsource".

kylomas

Edit: assumption - this is assuming that you are looking for something specific in the page, if not just wait on "ieloadwait"

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Stanislav

Now my question is how can I know that the scrollbar has reached the bottom of the page?

If you only need to scroll down to the bottom of the page, there is a hotkey for that - just send "{END}" key to the IE window.

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com/forum/topic/124829-how-to-get-the-position-of-the-scrollbar-in-the-page/")

$hwnd = _IEPropertyGet($oIE, "hwnd")

ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{END}")

Share this post


Link to post
Share on other sites
zhaicheng

visit:http://autoit.net.cn/viewthread.php?tid=16273&from=favorites

#include <IE.au3>

$oIE = _IE_Example ("form")

$oSubmit = _IEGetObjByName ($oIE, 'textExample' )

MsgBox(0,'相对位置','左'&$oSubmit.getBoundingClientRect().left&'|上'&$oSubmit.getBoundingClientRect().top&'|宽'&$oSubmit.offsetWidth&'|高'&$oSubmit.offsetHeight)

$o_doc = _IEDocGetObj($oIE)

MsgBox(1,1,$o_doc.DocumentElement.clientHeight )

MsgBox(1,1,$o_doc.DocumentElement.ScrollHeight )

Share this post


Link to post
Share on other sites
zhaicheng

Zedna ,kylomas ,Stanislav ,I really appreciate all your kind help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.