 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
eagle00789
Joined: 27 Nov 2006 Posts: 52 Location: Heerlen Country: Netherlands
|
Posted: Wed Jun 18, 2008 1:11 am Post subject: check checkbox if unchecked on mousehover |
|
|
I need te check a checkbox in a window (printer settings window), but the only thing i know is it's location. it is possible by getting the location of the checkbox, to get it's name and by the name get it's state and if it is checked, just close the window, or if unchecked, check it and close the window.
so basicly i want to make sure it is checked before my program runs. (it needs double sided printing enabled on many different types and makes of printers, as it controls around 24 printers at the same time) _________________ Before asking a question try to read the manual
Always use the code sections when you paste some code |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1128
|
Posted: Wed Jun 18, 2008 2:55 am Post subject: |
|
|
| Code: | MouseMove, %LocationX%, %LocationY%, 0 ; move the mouse over the control
MouseGetPos, , , , cHWND, 2 ; grab the control's handle
Loop 2 ; check it twice
{
ControlGet, Checked, Checked, , , Ahk_ID %cHWND% ; get the state of the checkbox
If (Checked) ; is it checked ?
Break ; then leave the loop
Else ; not checked ?
Click ; click where the mouse is (right over the checkbox)
Sleep 50 ; give the window time to update the control
}
Send {enter} ; close the window
; etc... | untested. You'll have to tweak it. _________________ My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags |
|
| Back to top |
|
 |
eagle00789
Joined: 27 Nov 2006 Posts: 52 Location: Heerlen Country: Netherlands
|
Posted: Wed Jun 18, 2008 5:55 pm Post subject: |
|
|
No tweaking needed. it does the job perfectly. thx mate _________________ Before asking a question try to read the manual
Always use the code sections when you paste some code |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|