Jump to content

How to scroll activeX (IE) object with buttons


Ruud0209
 Share

Recommended Posts

Hello,

could someone please look at this an show me the way (or fill in the blanks).

I've been fiddling with focus thingies and send keys but i'm getting nowhere.

(it's for a touch screen only setup)

any help appreciated.

thanks in advance,

Ruud

#include <GUIConstants.au3>
#Include <IE.au3> 

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 1024, 772,(@DesktopWidth - 1024) /2, (@DesktopHeight - 768) /2,BitOR($WS_POPUP,$WS_EX_TOPMOST))
$but_omleindhoven = GUICtrlCreateButton("Omleidingen Eindhoven", 5, 15, 129, 97, $BS_MULTILINE)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
$but_omlhelmond = GUICtrlCreateButton("Omleidingen Helmond", 5, 128, 129, 97, $BS_MULTILINE)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
$but_omlnijmegen = GUICtrlCreateButton("Omleidingen Nijmegen", 5, 241, 129, 97,$BS_MULTILINE)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
$but_omlgennep = GUICtrlCreateButton("Omleidingen Gennep", 5, 354, 129, 97, $BS_MULTILINE)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
$but_webcomm = GUICtrlCreateButton("Perdis WebComm", 5, 467, 129, 97, $BS_MULTILINE)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
$but_scrollup = GUICtrlCreateButton("5", 5, 590, 129, 73, 0)
GUICtrlSetFont(-1, 48, 800, 0, "Webdings")
$but_scrolldown = GUICtrlCreateButton("6", 5, 669, 129, 73, 0)
GUICtrlSetFont(-1, 48, 800, 0, "Webdings")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Obj = _IECreateEmbedded ( )                                                                     
        $browser = GUICtrlCreateObj($Obj,140, 0, 886, 772 )                                     
        GUISetState(@SW_SHOW)                                                                    
        ;_IENavigate ($Obj, 'http://omlzuil.hermes.nl/zuil_overzicht.asp?rayon=EINDHOVEN')
        _IENavigate ($Obj, 'http://www.nu.nl')
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $but_omleindhoven
            _IENavigate($Obj, 'http://www.autoitscript.com')
        Case $but_omlhelmond
            _IENavigate($Obj, 'http://www.autoitscript.com')
        Case $but_omlnijmegen
            _IENavigate($Obj, 'http://www.autoitscript.com')
        Case $but_omlgennep
            _IENavigate($Obj, 'http://www.autoitscript.com')
        Case $but_webcomm
            _IENavigate($Obj, 'http://www.autoitscript.com')
        Case $but_scrollup  
                ;blanks
        Case $but_scrolldown    
               ;blanks

    EndSwitch
WEnd
Link to comment
Share on other sites

Hello,

could someone please look at this an show me the way (or fill in the blanks).

I've been fiddling with focus thingies and send keys but i'm getting nowhere.

(it's for a touch screen only setup)

any help appreciated.

thanks in advance,

easy, but not really perfect way....

Case $but_scrollup
                ControlSend("AForm1","","Internet Explorer_Server1","{UP}")
        Case $but_scrolldown  
               ControlSend("AForm1","","Internet Explorer_Server1","{DOWN}")

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Controlling the object you would use:

$deltaX = 0
$deltaY = 40 ; in pixels, positive scrolls down, negative up
$obj.document.parentwindow.scrollBy($deltaX, $deltaY)

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

Link to comment
Share on other sites

Controlling the object you would use:

$deltaX = 0
$deltaY = 40 ; in pixels, positive scrolls down, negative up
$obj.document.parentwindow.scrollBy($deltaX, $deltaY)

Dale

Hi,

I tried your solution but somehow it does not work when there is a scrollable DIV (maybe Iframes too) in the page and you want to scroll that too.

With the other solution I do have to set focus to the DIV but then I can scroll it.

With this solution only the IE object scrolls, wich is of course perfect if thats all you need ;).

Thank you kindly for your input, I learned something anyway :lmao:

regards,

Ruud

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...