Jump to content
Sign in to follow this  
tommytx

How to scroll a Gui Window that has IE loaded up.

Recommended Posts

tommytx

Can anyone help me with this. I need to scroll the gui box to the right about 6 clicks of the right arrow and 5 clicks of the down arrow to view the required information... can't seen to get it to work.. I don't want to have to divert to the dark ages by winactivate then actually Mouse move the cursor to the right arroow and click on it... Can someone please help... Thanks...

#include <IE.au3>
#include <GUIConstants.au3>
#include <GuiconstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
$hGUI = GUICreate("Win1", 500, 300, 600,20)
$oIE1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($oIE1, 5, 5, 490, 290)
GUICtrlSetResizing($Obj1_ctrl, 0x0001)
GUISetState(@SW_SHOW)
$oIE1 =  _IENavigate($oIE1, "beachrealty.com")


Course these won't work...
; ControlSend ( "Win1", "", controlID, "Scroll Down or Right Arrow")
; ControlSend ( "Win1", "", controlID, "Scroll Up or Down Arrow")


While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
EndSelect
Sleep(100)
WEnd

Share this post


Link to post
Share on other sites
tommytx

I have it basically working by using document insert html at top of page... by inserting a javascript into the top of the page as soon as it loads the javascript command "windowscroll(100,200) basically works... but sure would like to hear some ideas on how it could be done with AutoIT so I don't have to monkey with someone else's page..

I Just want to use a small window and have the page upon load scroll down and right until I can see a dynamic change on the screen without manually scrolling myself as the page reloads each 14 min and that is a pain...

Thanks in advance...for new ideas..

Share this post


Link to post
Share on other sites
DaleHohm

Add this to your code - ask questions if you don't understand (btw, you're using _IEVavigate incorrectly - corrected here):

_IENavigate($oIE1, "beachrealty.com")
$oImage = _IEImgGetCollection($oIE1, 6)
$oImage.scrollIntoView

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
tommytx

Wow! Thank you Dale... that works fantastic... actually I did not need to skew an image, but using your instructions I was able to skew text and it worked exactly the same way..

if $results >= 0 then
$oDiv = _IEGetObjById ($oIE1, "theTime")
$oDiv.scrollIntoView
EndIf

I hate to look a gift horse in the mouth, as this will work just fine... however it would even look better if there was some way to control the actual landing.. as it places the item in top left corner of the existing window... so if its a short item it looks a little sloppy not centered in the window... For example if the window is 20 characters wide, and the word that scrolls will look like this. |.Dog Run........| The | symbol is trying to simulate my window size... hee...hee. |....Dog Run.... | The dots were used to keep the page from removing all the spaces and then you could not see what I was trying to show you.. The centering is Asthetically pretty... but not absolutely necessary. What you gave me is fantastic, but I just have to ask since you seem to be a miracle worker... is there any way to tell it something line scrollinto view - 100px for example to center the word in the existing window... Thanks a million though for solving the basic problem.. anything else is gravy..

Edited by tommytx

Share this post


Link to post
Share on other sites
DaleHohm

Suggest you try an advanced search of the General Help and Support forum... search for DaleHohm as the author and the keyword scoll - you'll find lots of examples.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
tommytx

Thanks. That gave me a wealth of information on scrolling and also helped me better understand the main forum seach section.

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  

×