acidfear Posted February 6, 2007 Share Posted February 6, 2007 (edited) I'm stuck on a problem :/ I'm writing a program that writes to the registry. I have checkboxes for each type of reg key there is (string, binary,dword etc..) I am stuck on how to check every checkbox for the checked one. I would assume using arrays would work, but I haven't been able to figure it out. Here the array code I used. $check1 - $check2 etc... are the gui checkbox labels for $x = 1 to 5 step 1 if $check($x) = $gui_checked then $valid = $check($x) else etc... endif next When i try to use $valid as the key type in regwrite, it doesn't seem to work. Could it be because in the array $check($x) isn't being read as $check1 etc..? Thanks in adv. Edited February 6, 2007 by acidfear Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 6, 2007 Share Posted February 6, 2007 Hi, maybe you forgot GuiCtrlRead(variable) = $gui_Checked ... So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
McGod Posted February 6, 2007 Share Posted February 6, 2007 All the checkbox's are in an array, and the button will loop the array to check the stats. Note: GUICtrlRead ( $checkboxes[$i], 1 ) just grabs the name. #include <GUIConstants.au3> Dim $checkboxes[4] #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Checkbox Check", 315, 310, 193, 115) $Checkboxes[0] = GUICtrlCreateCheckbox("ACheckbox1", 104, 72, 97, 17) $Checkboxes[1] = GUICtrlCreateCheckbox("ACheckbox2", 104, 104, 97, 17) $Checkboxes[2] = GUICtrlCreateCheckbox("ACheckbox3", 104, 136, 97, 17) $Checkboxes[3] = GUICtrlCreateCheckbox("ACheckbox4", 104, 168, 97, 17) $Button1 = GUICtrlCreateButton("Check states", 104, 192, 105, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 For $i = 0 To UBound ( $checkboxes ) - 1 Step 1 If GUICtrlRead ( $checkboxes[$i] ) = $GUI_CHECKED Then MsgBox ( 1, GUICtrlRead ( $checkboxes[$i], 1 ), "This checkbox is checked." ) Else MsgBox ( 1, GUICtrlRead ( $checkboxes[$i], 1 ), "This checkbox is not checked." ) EndIf Next EndSwitch WEnd [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
BrettF Posted February 6, 2007 Share Posted February 6, 2007 (edited) IF BitAnd(GUICtrlRead($Item),$GUI_CHECKED) = $GUI_CHECKED Then Edit: I think that works... Edited February 6, 2007 by bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
acidfear Posted February 7, 2007 Author Share Posted February 7, 2007 Awesome! I forgot about the method chip gave. Works just the way I had in mind. Thanks all for the help!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now