Sign in to follow this  
Followers 0
toonboon

Remove Scrollbars in embedded IE?

5 posts in this topic

#1 ·  Posted (edited)

I searched the forum about this, and came up with the solution of placing the line

$oIE.document.body.scroll = "no"

in my script. It worked great, at my pc at my mother's house. But now, at my pc at my father's house, it isn't working anymore. The scrollbars aren't disappearing, and I can still scroll the webpage.

Both PC's run on WinXP so the problem doesn't lie in the OS.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <MsnChangeMessage.au3>

_IEErrorHandlerRegister()

$oIE = _IECreateEmbedded()
$GUI = GUICreate("Last.fm Player", 300, 221, -1, -1, $WS_POPUP, $GUI_WS_EX_PARENTDRAG)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 221)
GUISetState() ;Show GUI
$username = "toonboon"
_IENavigate($oIE, "http://www.last.fm/listen/user/" & $username & "/personal")
sleep(1000)
$oIE.document.body.scroll = "no"
$oIE.document.parentwindow.scroll(32,146)
GUISetState()
sleep(1000)
$oIE.document.parentwindow.scroll(32,146)
WinSetTitle($GUI, '', StringReplace($oIE.document.title, " - Last.fm", ""))
ChangeMSNMessage(True, StringReplace($oIE.document.title, " - Last.fm", "") & " @ Last.fm by LMP")
Sleep(4000)
ChangeMSNMessage()
Exit
Edited by toonboon

[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites



When I try this

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>

_IEErrorHandlerRegister()

$oIE = _IECreateEmbedded()
$GUI = GUICreate("Last.fm Player", 300, 221, -1, -1, $WS_POPUP, $GUI_WS_EX_PARENTDRAG)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 300, 221)
$username = "toonboon"
_IENavigate($oIE, "http://www.last.fm/listen/user/" & $username & "/personal")
WinSetTitle($GUI, '', StringReplace($oIE.document.title, " - Last.fm", ""))
$oIE.document.body.scroll = "no"
$oIE.document.body.style.border = "0px"
$oIE.document.parentwindow.scroll(32,146)

GUISetState()

while 1
WEnd
Exit

the scrollbars are initially visible... but the page seems still to load. When the page has loaded, the scrollbars vanish. I guess it has something to do with the page not fully loaded initially.

Share this post


Link to post
Share on other sites

Still not working, left the GUI open when I took a shower, Been open for about 15 mins.. I think I'll just put buttons over them. Is there something that I can place over the embedded IE, that will 'take' the scrolling I do on the IE, just so that it'll be unscrollable. Maybe an invisible graphic or something like that?


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There is something that is preventing the page from fully loading and I think if you use SciTe Debug mode (#AutoIt3Wrapper_Run_Debug_Mode=Y) you'll see that it is waiting for the _IENavigate to return.

So, my suggestion is to 1) turn off the automatic _IELoadWait in _IENavigate and 2) manage the ready state yourself... fully loaded is readystate=4, you really only need readystate=2 (on reflection, 3 might be better... it goes 1-4 uninitialized, loading, interactive, complete) to have the body element avaliable to you...

so...

_IENavigate($oIE, "http://www.last.fm/listen/user/" & $username & "/personal", 0)
While _IEPropertyGet($oIE, "readyState") < 3
    Sleep(200)
WEnd

Dale

p.s. I hope that you see that this information will likely be valuable to others as well - which is why I refused to provide support to you in PM when you asked

Edit: changed readystate check from 2 to 3

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

OK thank you very man =)

Sorry again for PM'ing you, I thought it was the best thing to do.


[right]~What can I say, I'm a Simplistic person[/right]

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  
Followers 0