zhaicheng Posted January 29, 2011 Posted January 29, 2011 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!
Zedna Posted January 29, 2011 Posted January 29, 2011 (edited) Look into helpfile at this, there is nice example #Include <GuiScrollBars.au3> _GUIScrollBars_GetScrollPos($hWnd, $nBar) But I'm not sure if it will work also with IE Edited January 29, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
zhaicheng Posted January 29, 2011 Author Posted January 29, 2011 Look into helpfile at this, there is nice example #Include <GuiScrollBars.au3> _GUIScrollBars_GetScrollPos($hWnd, $nBar) But I'm not sure if it will work also with IE Thanks.But it seems not working.
kylomas Posted January 29, 2011 Posted January 29, 2011 (edited) 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 January 29, 2011 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
Stanislav Posted January 30, 2011 Posted January 30, 2011 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}")
zhaicheng Posted February 1, 2011 Author Posted February 1, 2011 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 )
zhaicheng Posted March 5, 2011 Author Posted March 5, 2011 Zedna ,kylomas ,Stanislav ,I really appreciate all your kind help.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now