Jump to content

Auto-click on webpage background


Recommended Posts

I use this simple script to keep track of where I've been while

virus-hunting so I can report the infected site to Google webmaster.

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

$Form1 = GUICreate("Site Log", 145, 110, 192, 124, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES))
$gobutton = GUICtrlCreateButton("GO--1.5 sec.", 13, 8, 120, 49)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$loggerbutton = GUICtrlCreateButton("logger", 13, 59, 57, 20)
$iebutton = GUICtrlCreateButton("IE on",75, 59, 57, 20)
$psbutton = GUICtrlCreateButton("Pics on", 13, 82, 57, 20)

GUISetState(@SW_SHOW)

;once site is open(ing) (& you push button1)you have 1.5 seconds to click somewhere on the webpage
;you don't usually get a lot of time if it is an infected site
While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit

        Case $nMsg = $iebutton
            $oIE = _IECreate("http://www.google.com/")

        Case $nMsg = $loggerbutton
            Run("site log record.exe", @ScriptDir); ClipGet & _FileWriteLog Straight out of the help section

        Case $nMsg = $psbutton
            Run("PrintScreen.exe", @ScriptDir);highly stripped-down version of "screen capture marquee2". Triggered by pressing prt scr.

        Case $nMsg = $gobutton
            Sleep(1500)
            Send("!d");select address bar
            Sleep(300)
            Send("^c");gets me the _FileWriteLog
            Send("^v");paste it back in otherwise it just don't work out
            Send("{enter}")

    EndSelect
WEnd

After pressing the 'go' button I need to click anywhere on the web page

or the script does not work as intended.

My question is: is there a method of automaticly clicking on the page?

(I won't know the page name, text in advance)

This would save me 1.5 seconds which can be make-or-break if the site is infected.

New variant definitions can be hard to come by, but worth-while if other less-adventurous

folks are spared the hassle.

Link to comment
Share on other sites

This assumes that you want to use the window created with the "IE on" button.

Had to do a bit of research to figure out the best way to accomplish this myself, so I learned something as well. :unsure:

Case $nMsg = $gobutton    
    WinActivate(_IEPropertyGet($oIE,"hwnd"))    ;Gets the IE window handle and runs the WinActivate() function against it.    
    Send("!d")  ;select address bar    
    Sleep(300)    
    Send("^c")  ;gets me the _FileWriteLog    
    Send("^v")  ;paste it back in otherwise it just don't work out    
    Send("{enter}")

This isn't clicking on the webpage background, but no such action should be necessary as long as Internet Explorer is the active window.

Edited by bwochinski
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...