Sign in to follow this  
Followers 0
jebus495

Center an embedded IE browser on a control

4 posts in this topic

#include <ie.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$oIE = ObjCreate("Shell.Explorer.2")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1000, 600)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 725, 450)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$oIE.navigate("http://www.addictinggames.com/kittencannon.html")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

This is quite simple. I need the flash control (the kitten cannon game) to be universally centered on the embedded browser. control. I won't lie I didn't search but only because I have no idea what I would even search for to find the answer to the question I don't even know how to ask lol.

My purpose is to write a simple bot for the game that repeatedly plays and records scores above a certain threshold in a log format with date and time. I don't actually plan on giving this to anyone. It's just for the fun and experience and I thought this would be a game that would be pretty inconsequential to bot.

Share this post


Link to post
Share on other sites



Bump. ;)

Share this post


Link to post
Share on other sites

_IENavigate($oIE, "http://www.addictinggames.com/kittencannon.html")
Do
    $oObj = _IEGetObjById($oIE, "FlashContent")
    Sleep(200)
Until IsObj($oObj)

$oObj.scrollIntoView()

That is absolutely what I need.

Here's what I did:

#include <ie.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("Form1", 1000, 600)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 745, 470)
GUISetState(@SW_SHOW)
$oIE.navigate("http://www.addictinggames.com/kittencannon.html")
_IELoadWait($oIE)
Do
    $oObj = _IEGetObjById($oIE, "FlashContent")
    Sleep(200)
Until IsObj($oObj)
$oObj.scrollIntoView()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Is there anyway to disable/remove the scrollbars?

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