Jump to content

ControlClick checkmarks on Superantispyware


 Share

Recommended Posts

I am trying to do an automated way of clicking the check-marks if they are not checked by default. (checking Potentially unwanted programs)

This example clicks where the check-mark box is whether checked or not(By the way. I am doing it by Instance, it seems to be always 2 or 3. I would do it by ID, except for some reason, it clicks Manage Quarantine Items from the main menu when I do that):

If WinExists("SUPERAntiSpyware", "Place a checkmark next to the items you wish to") Then

WinActivate("SUPERAntiSpyware", "Place a checkmark next to the items you wish to")

WinWaitActive("SUPERAntiSpyware", "Place a checkmark next to the items you wish to")

ControlClick("SUPERAntiSpyware Tech Edition","","[CLASS:ListControl_WndClass; INSTANCE:2]","Left",1,29,27)

ControlClick("SUPERAntiSpyware Tech Edition","","[CLASS:ListControl_WndClass; INSTANCE:3]","Left",1,29,27)

EndIf

Any suggestions on how I would determine if it is checked or not checked?

Thanks

Link to comment
Share on other sites

I was thinking of using PixelSearch to match the color of the check mark, however pixelsearch uses window or absolute coordinates. Is there a way to convert the ControlClick Coords to either window or absolute coordinates? I could probably do it if that could be done...

Link to comment
Share on other sites

I think the ControlCommand function will help you out here. I use that command this way; to check which options are selected (checked), and format the text used in a MsgBox statement accordingly. The ControlClick function is then used to click on a button, and then a wait happens for that button to become enabled again.

Func Submit()
; Prepare 'Ask to submit' text
Local $Submittable, $SubmitTo

    $Submittable  = ControlCommand("Forum Spam List Checker", "", "Button3", "IsChecked")
    $Submittable &= ControlCommand("Forum Spam List Checker", "", "Button4", "IsChecked")
    Switch $Submittable
        Case 00
        Case 01
            $SubmitTo = "Submit to Botscout?"
        Case 10
            $SubmitTo = "Submit to StopForumSpam?"
        Case 11
            $SubmitTo = "Submit to StopForumSpam and Botscout?"
    EndSwitch
; Ask to Submit
    If $Submittable <> 00 And MsgBox(36, StringTrimRight(@ScriptName, 4), $SubmitTo) = 6 Then
     ControlClick("Forum Spam List Checker", "", "Button5") ;Submit button
     Sleep(250)
        Do
            Sleep(10)
        Until ControlCommand("Forum Spam List Checker", "", "Button5", "IsEnabled") ; Wait until Submission is done
    EndIf
EndFunc

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

That would work if the checkmarks had seperate ID's. It seems that everything in the box is the same ID, the only thing that changes when moving the mouse around in the box mousing over the checkboxes is the controlclick coords. Here is a screenshot of what it is and I highlighted the area where it is just one ID.

post-68048-0-70453400-1319872626_thumb.j

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...