Jump to content
Sign in to follow this  

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)


;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()
        Case $nMsg = $GUI_EVENT_CLOSE

        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
            Send("!d");select address bar
            Send("^c");gets me the _FileWriteLog
            Send("^v");paste it back in otherwise it just don't work out


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.

Share this post

Link to post
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    
    Send("^c")  ;gets me the _FileWriteLog    
    Send("^v")  ;paste it back in otherwise it just don't work out    

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

Share this post

Link to post
Share on other sites

Works like a charm & adds many more possibilities toward automating the virus searches.

I'd name my next new def. after you, but that would make you unhappy.

Thanks again.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...