ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Help needed for select and deselecting a checkbox

(1/1)

rainbal:
Hi,

Using winactive, we can activate a window but how to uncheck and check a box ? What is the command for it, as i need it but the check box is inside a java window.

Please help

Thanks a lot

SleepingWolf:
First step, specify whether you're working with AutoIt or AutoHotkey or other...

Have you checked the appropriate websites/ forums. I'm sure the answers will be a search away... ;D

rainbal:
Hi,

I want to write script with Autohotkey only. I've the website but couldn't find anything.

Thanks for your reply.

JoTo:
Hi there,

I don't use AHK but only AutoIT. But my suggestion should work anyway in AHK as well, as this is standard behaviour from operating system.

A windows checkbox can set by keypresses like this (don't know if JAVA behaves like a standard windows checkbox though):

- Plus sign (+) force to checked state. If its already checked it will stay checked.
- Minus sign (-) force to unchecked state. If its already unchecked it will stay unchecked.
- SpaceBar toggles the checkbox. So if it's unchecked it gets checked and vice versa.

So make the checkbox to have the focus by an AHK command and then use an AHK command to send keystrokes as described above (in AutoIt this would be the SendKeys-command - dunno for AHK though).

HTH
JoTo

SleepingWolf:
Another approach, if you know the window has roughly the same dimensions each time you use it, just guide the mouse to the right spot and then send a mouse click. This way might be easier as you don't need to get a list of controls and then work out which one you want. That would be the best way of course, once you've done the hard work of programming it. My way above would be a quick hack.

In case you're wondering though, people are less likely to devote time to programming a solution they can't test. Which java program are you using and which screen is it you need help with? Maybe you could post a picture of it? Without such info you're likely to get only general advice. Good luck.

Navigation

[0] Message Index

Go to full version