jb7 Posted September 13, 2012 Share Posted September 13, 2012 (edited) I am trying to make sure a check box is checked in Internet Properties - advanced tab, but ControlTreeView "IsChecked" returns -1:not a checkboxRun("control inetcpl.cpl,,6") WinWaitActive("Internet Properties") $treeview = ControlGetHandle("", "", "[CLASS:SysTreeView32; INSTANCE:1]") ControlTreeView ("","",$treeview ,"Select", "#1|#1") ; works Ok - it selects an item MsgBox("","",ControlTreeView ("","",$treeview ,"IsChecked", "#1|#1")) ; shows -1 ControlTreeView ("","",$treeview ,"Check", "#1|#1") ;does not workAny ideas how at least to get checkbox's state, then I can use Space to check it if neededthanksEDIT:1) the target checkbox is "Enable Browser Extensions", but this is not really important, because they are all the same2) The user has no admin rights, so he can not change registryUPDATE: The HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain does not require admin rights, so the solution is to use RegWrite. Thanks to all! Edited October 1, 2012 by jb7 Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2012 Share Posted September 13, 2012 Hi, It's not a "raw checkbox", but a "treeview checkbox", take a look at this function which should do the trick : _GUICtrlTreeView_SetChecked Br, FireFox. Link to comment Share on other sites More sharing options...
jb7 Posted September 13, 2012 Author Share Posted September 13, 2012 Hi, It's not a "raw checkbox", but a "treeview checkbox", take a look at this function which should do the trick : _GUICtrlTreeView_SetChecked Br, FireFox. How do I get handle of the checkbox? In the docs they create checkboxes themselves and get handle in the proceess $hItem[$x]=GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item",$x+1),$hTreeView) ... _GUICtrlTreeView_SetChecked($hTreeView,$hItem[$hRandomItem]) Link to comment Share on other sites More sharing options...
Bert Posted September 13, 2012 Share Posted September 13, 2012 These settings can be maintained in the registry. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
James Posted September 13, 2012 Share Posted September 13, 2012 (edited) These settings can be maintained in the registry.A quick note from something I've found over the years. When modifying the registry of a program that's currently running, you may need to restart it, as the program didn't make the changes itself, it can't automatically reflect them. Edited September 13, 2012 by James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2012 Share Posted September 13, 2012 How do I get handle of the checkbox? In the docs...Yes, in the docs like you said, there is other funcs to get that handle : _GUICtrlTreeView_GetItemByIndex, _GUICtrlTreeView_FindItem, ...Br, FireFox. Link to comment Share on other sites More sharing options...
jb7 Posted September 13, 2012 Author Share Posted September 13, 2012 Yes, in the docs like you said, there is other funcs to get that handle : _GUICtrlTreeView_GetItemByIndex, _GUICtrlTreeView_FindItem, ... Br, FireFox. Thanks, it gets the handle but it does not select it or check the checkbox #include <GuiTreeView.au3> Run("control inetcpl.cpl,,6") WinWaitActive("Internet Properties") $treeview = ControlGetHandle("", "", "[CLASS:SysTreeView32; INSTANCE:1]") ControlTreeView ("","",$treeview ,"Select", "#1|#1") ;works Ok ControlTreeView ("","",$treeview ,"Check", "#1|#1") ; no action $hItemFound = _GUICtrlTreeView_FindItem($treeview, "Play system sounds") MsgBox("","",$hItemFound ); shows the handle Ok _GUICtrlTreeView_SetChecked($treeview,$hItemFound ) ; no action _GUICtrlTreeView_SelectItemByIndex("","",9) ; no action Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 13, 2012 Moderators Share Posted September 13, 2012 I would agree with scullion; most settings I do I just set it in the registry, rather than trying to manually navigate through the GUI. It will probably save you a lot of frustration. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Bert Posted September 13, 2012 Share Posted September 13, 2012 A quick note from something I've found over the years. When modifying the registry of a program that's currently running, you may need to restart it, as the program didn't make the changes itself, it can't automatically reflect them.Good catch! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jb7 Posted September 14, 2012 Author Share Posted September 14, 2012 (edited) These settings can be maintained in the registry.Thanks I did it !!!! But checkbox is still not recognized Edited September 14, 2012 by jb7 Link to comment Share on other sites More sharing options...
Bert Posted September 14, 2012 Share Posted September 14, 2012 I know you can also use the policy editor to do it. https://www.google.com/search?q=ie+policy+editor The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 14, 2012 Moderators Share Posted September 14, 2012 (edited) jb7, my old eyes may be deceiving me, but I don't see it mentioned exactly which checkbox you're trying to manipulate. Can you explain just what setting(s) you're trying to change? Edited September 14, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jb7 Posted September 18, 2012 Author Share Posted September 18, 2012 jb7, my old eyes may be deceiving me, but I don't see it mentioned exactly which checkbox you're trying to manipulate. Can you explain just what setting(s) you're trying to change?Actually I am able to change what I need through registry update, I need to make sure "Enable Browser Extensions" is checked. But as I said in the beginning, the script that is supposed to work doesn't work, so this may be interesting to the Autoit team. Link to comment Share on other sites More sharing options...
jb7 Posted October 1, 2012 Author Share Posted October 1, 2012 Just realized that I can not use the registry because the user has no admin rights. So back to original issue - Any ideas how to get checkbox's state in Internet Properties - advanced tab Link to comment Share on other sites More sharing options...
BrewManNH Posted October 1, 2012 Share Posted October 1, 2012 Where in the registry is the setting? Because if it's in HKCU, then the user can change it even without admin rights. jb7 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
jb7 Posted October 1, 2012 Author Share Posted October 1, 2012 Where in the registry is the setting? Because if it's in HKCU, then the user can change it even without admin rights.yes you are right, I used RegWrite and it worked. Question closed, thanks! 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