Sign in to follow this  
Followers 0
PcExpert

Check State

22 posts in this topic

Hello,

Does anyone knows how to check the state of a checkbox?

Share this post


Link to post
Share on other sites



Hello,

Does anyone knows how to check the state of a checkbox?

Look at ControlCommand() in the help file.

Share this post


Link to post
Share on other sites

Hello,

Does anyone knows how to check the state of a checkbox?

checkbox in what? an autoit script? an external application?


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

External

Share this post


Link to post
Share on other sites

OK, but I've tried it, but it doesn't work. This is the code:

Run("C:\Program Files\Hitman Pro\hitmanpro2.exe")

WinWaitActive("Hitman Pro")

MouseClick("left", 370, 570, 1)

ControlCommand("Hitman Pro", "", "92", "", "UnCheck")

MouseClick("left", 279, 325, 1)

ControlCommand("Hitman Pro", "", "15", "", "Check")

ControlCommand("Hitman Pro", "", "16", "", "Check")

MouseClick("left", 294, 343, 1)

ControlCommand("Hitman Pro", "", "89", "", "Check")

ControlCommand("Hitman Pro", "", "1001", "", "Check")

MouseClick("left", 306, 359, 1)

ControlCommand("Hitman Pro", "", "89", "", "Check")

ControlCommand("Hitman Pro", "", "1001", "", "Check")

ControlCommand("Hitman Pro", "", "11", "", "Check")

ControlCommand("Hitman Pro", "", "15", "", "Check")

Share this post


Link to post
Share on other sites

Changed code:

Run("C:\Program Files\Hitman Pro\hitmanpro2.exe")

WinWaitActive("Hitman Pro")

MouseClick("left", 370, 570, 1)

ControlCommand("Hitman Pro", "", "92", "UnCheck")

MouseClick("left", 279, 325, 1)

ControlCommand("Hitman Pro", "", "15", "Check")

ControlCommand("Hitman Pro", "", "16", "Check")

MouseClick("left", 294, 343, 1)

ControlCommand("Hitman Pro", "", "89", "Check")

ControlCommand("Hitman Pro", "", "1001", "Check")

MouseClick("left", 306, 359, 1)

ControlCommand("Hitman Pro", "", "89", "Check")

ControlCommand("Hitman Pro", "", "1001", "Check")

ControlCommand("Hitman Pro", "", "11", "Check")

ControlCommand("Hitman Pro", "", "15", "Check")

Share this post


Link to post
Share on other sites

Even though it doesn't sound this way - i think Hitman Pro is an Anti-Spyware App, not a game. :)

Share this post


Link to post
Share on other sites

Works fine on my computer.

Share this post


Link to post
Share on other sites

Changed code:

Check the state

$Check_State = BitAnd(GUICtrlRead($radio1),$GUI_CHECKED)

Check the state (was Unchecked)

GUICtrlSetState ($radio1,$GUI_CHECKED)

Hmm .... :)


"Our deepest fear is not that we are inadequate.Our deepest fear is that we are powerful beyond measure.It is our light, not our darkness that most frightens us."

Share this post


Link to post
Share on other sites

Check the state

$Check_State = BitAnd(GUICtrlRead($radio1),$GUI_CHECKED)

Check the state (was Unchecked)

GUICtrlSetState ($radio1,$GUI_CHECKED)

Hmm .... :)

need to keep up with what kind of control is being used here, it's external so that won't work.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

:"> :)

Forget what I said. Another script was messing with the controls. If I terminate that, no boxes are checked.

Sorry :mellow:

Share this post


Link to post
Share on other sites

But how can I automatic set options then, without modifying the ini file?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

If your still having the issue with:

ControlCommand("Hitman Pro", "", "89", "Check")

Try it with , "" after the Check - UnCheck

ControlCommand("Hitman Pro", "", 89, "Check", "")
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I'm gonna try it now

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Still doesn't work:

Code:

Run("C:\Program Files\Hitman Pro\hitmanpro2.exe")

WinWaitActive("Hitman Pro")

MouseClick("left", 370, 570, 1)

ControlCommand("Hitman Pro", "", "92", "UnCheck", "")

MouseClick("left", 279, 325, 1)

ControlCommand("Hitman Pro", "", "15", "Check", "")

ControlCommand("Hitman Pro", "", "16", "Check", "")

MouseClick("left", 294, 343, 1)

ControlCommand("Hitman Pro", "", "89", "Check", "")

ControlCommand("Hitman Pro", "", "1001", "Check", "")

MouseClick("left", 306, 359, 1)

ControlCommand("Hitman Pro", "", "89", "Check", "")

ControlCommand("Hitman Pro", "", "1001", "Check", "")

ControlCommand("Hitman Pro", "", "11", "Check", "")

ControlCommand("Hitman Pro", "", "15", "Check", "")

What's wrong?

Edited by PcExpert

Share this post


Link to post
Share on other sites

Still doesn't work:

Code:

What's wrong?

I don't know what HitMan Pro is although it sounds familiar... try using the ClassNameNN there instead of the control ID's. Also, make sure that's the right Window Title. Also, the Control ID's have text on the Controls more than likely, try using that too.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hitman Pro is a all in one antispyware solution and I'm gonna try it again

Share this post


Link to post
Share on other sites

I tried it, but it still doesn't work.

CODE:

Run("C:\Program Files\Hitman Pro\hitmanpro2.exe")

WinWaitActive("Hitman Pro")

MouseClick("left", 370, 570, 1)

ControlCommand("Hitman Pro", "", "Button43", "UnCheck", "")

MouseClick("left", 279, 325, 1)

ControlCommand("Hitman Pro", "", "Static6", "Check", "")

ControlCommand("Hitman Pro", "", "Static7", "Check", "")

MouseClick("left", 294, 343, 1)

ControlCommand("Hitman Pro", "", "Button41", "Check", "")

ControlCommand("Hitman Pro", "", "Edit4", "Check", "")

MouseClick("left", 306, 359, 1)

ControlCommand("Hitman Pro", "", "Button41", "Check", "")

ControlCommand("Hitman Pro", "", "Edit4", "Check", "")

ControlCommand("Hitman Pro", "", "Static4", "Check", "")

ControlCommand("Hitman Pro", "", "SysHeader321", "Check", "")

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

looks like there are all kind of stacked hidden controls.

This seems to work fine for the last page:

ControlCommand("Hitman Pro", "", "Heuristic analysis", "Check", "") 
ControlCommand("Hitman Pro", "", "Scan all local drives", "Check", "")
ControlCommand("Hitman Pro", "", "Search for low-risk threats", "Check", "") 
ControlCommand("Hitman Pro", "", "Improved spyware removal", "Check", "")
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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