Ray
Fri Apr 07 14:26:35 CDT 2006
Fosco wrote:
> "Ray"
>> I am trying to write a script to un-check the DNS box "Register
>> Connection's Addresses in DNS" on a windows XP Professional workstation.
>> It is changing the wring box. Does anyone have the code to accomplish
>> this task?
>
> I have not XP here .. is "check" a checkbox ? ... :
>
>
http://www.hiddensoft.com/autoit3/
>
> ControlCommand
> --------------------------------------------------------------------------------
> Sends a command to a control.
> ControlCommand ( "title", "text", controlID, "command" [, "option"] )
> Command, Option Return Value
> "IsChecked", "" Returns 1 if Button is checked, 0 otherwise
> "Check", "" Checks radio or check Button
> "UnCheck", "" Unchecks radio or check Button
>
>
> ; generic sample in a form named Aform1 with 1 checkbox named Button1
>
> AutoItSetOption("WinTitleMatchMode", 4)
> WinActivate("AForm1")
> WinWaitActive( "AForm1", "", 5 )
> WinActivate("AForm1")
> $a = ControlCommand ( "AForm1", "ACheckbox1", "Button1", "IsChecked", "")
> MsgBox(262144, "", $a)
> Sleep(2000)
> ControlCommand ( "AForm1", "ACheckbox1", "Button1", "Check", "")
> $a = ControlCommand ( "AForm1", "ACheckbox1", "Button1", "IsChecked", "")
> MsgBox(262144, "", $a)
> Sleep(2000)
> ControlCommand ( "AForm1", "ACheckbox1", "Button1", "UnCheck", "")
> $a = ControlCommand ( "AForm1", "ACheckbox1", "Button1", "IsChecked", "")
> MsgBox(262144, "", $a)
>
>
>
> ; optional code for Aform1 for testing
>
> #include <GUIConstants.au3>
> ; == GUI generated with Koda ==);
> $Form1 = GUICreate("AForm1", 527, 324, 194, 127)
> $Checkbox1 = GUICtrlCreateCheckbox("ACheckbox1", 184, 64, 97, 17)
> GUISetState(@SW_SHOW)
> While 1
> $msg = GuiGetMsg()
> Select
> Case $msg = $GUI_EVENT_CLOSE
> ExitLoop
> Case Else
> ;;;;;;;
> EndSelect
> WEnd
>
> --
> Fosco
>
>
>
>
>
>
>
Thanks I will try it
Ray