Jump to content
Arka

Unable to click on the checkbox using Controltreeview command in Autoit

Recommended Posts

Arka

Unable to check the checkbox under IE settings,

>Internet Option>Advanced>first option

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>

$CMD = "inetcpl.cpl"
RunWait(@ComSpec & " /c " & $CMD);
WinWaitActive("[CLASS:#32770]");
ControlClick("Internet Properties", "Use de&fault", "[CLASS:Button;INSTANCE:2]", "");
Send("+{TAB 2}");
Send("+ {RIGHT 6}");
ControlTreeView ("Internet Options", "", "[CLASS:SysTreeView32; INSTANCE:1]", "check", "#0|#1" )

Unable to select the values inside IE advanced tool, So used Controltreeview. But using the above scripts unable to check the checkbox. I dont want to use "SEND" command.

Can someone please help me with this.Autoit issue.PNG

Edited by Arka

Share this post


Link to post
Share on other sites
AutoBert

Also RunWait is blocking.

Edited by AutoBert

Share this post


Link to post
Share on other sites
Arka

Thanks for the reply. I will try the above. :)

Share this post


Link to post
Share on other sites
Arka

Did that using Regwrite. using below:

Local $sVar = RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "UseSWRender", "REG_DWORD", "0x00000000")

Working fine. :)

Share this post


Link to post
Share on other sites
Arka

Hey All,

One problem after implementing the above approach is:

Different OS like OS 7,8 has different regkey name. Please tell me if any other approach is available. It tooks lots of time to find a registry key for a advanced settings. 

Local $sVar = RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "UseSWRender", "REG_DWORD", "0x00000000")
Edited by Arka

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • gahhon
      By gahhon
      I only found that AutoIt can actually execute the entire python script or execute the .exe (converted to .exe from .py)
      But what if I just want call the particular function? If that possible to do so?
      This is because python can't create fancy GUI like AutoIT does. So my plan is use AutoIT to have fancy GUI.
      Then each buttons will trigger specific function in the python script or .exe file.
      For instances:
      btnSum - trigger function in python script or .exe file (funcSum)
      btnMinus - trigger function in python script or .exe file (funcMinus)
       
      Thanks for advance information.
    • nacerbaaziz
      By nacerbaaziz
      Hello my friends
      Can we create a single context menu on more than one item?
      For example, a context menu includes standardized options on more than one control, such as buttons or check boxes
      to Create a context menu on one item am using this function
      GUICtrlCreateContextMenu ($ HWND)
      How to link it with more than one element please?
      or if we can't do that, please give me a solution
      so i tried to add an context menus to all the controls but the script will be long, for that if their are any solutions i hope to give it to me
      thanks in advanced
    • gahhon
      By gahhon
      _Metro_SplashTextScreen(1, "", $iMsg) AdlibRegister("_Metro_LoopInProgress") DirRemove($DIR_WA_FOLDER, 1) Local $iCopy = _WinAPI_ShellFileOperation($CUR_WA_FOLDER, $DIR_WA_FOLDER, $FO_COPY, BitOr($FOF_SIMPLEPROGRESS, $FOF_NOCONFIRMMKDIR)) AdlibUnRegister("_Metro_LoopInProgress") _Metro_SplashTextScree If @error Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf According to the help file of _WinAPI_ShellFileOperation there are a lot of failure and error code. But how can I handle all of them and display corresponding error message based on the help file?
      The incident is like this:
      I'll lock the folder with permission, so when I execute the _WinAPI_ShellFileOperation to copy and overwrite the folder contents, it popped me an error message saying that permission issue to caused I can't access the folder and overwrite the contents.

      Then I clicked Cancel button, and my AutoIT application exit immediately and it's not execute the function _Metro_MsgBox(0, "", $iCopy) to display the message.
       
      Anyway, I did also tried the code below, the it still display "Application is up to date!"
      According to the help file, 120 - Security settings denied access to the source.
      If @error = 120 Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf  
    • gahhon
      By gahhon
      I have a application that have a function is to create a shortcut to desktop, lets say is ChromePortable.lnk.
      $iCreate = FileCreateShortcut($DIR_WA_FOLDER & '\GoogleChromePortable.exe', $DIR_SHORTCUT, $DIR_WA_FOLDER, '--kiosk "https://example.com/"') So the shortcut will be launch as kiosk mode and force to enter the specific website. However, the user is still able to right-click on the shortcut and modify the target value to remove the kiosk mode. What can I do to disable the user to editing the target value?
      So far, I had asked and tried from SuperUser for advises Disable Shortcut Target Field
      icacls "ChromePortable.lnk" /GRANT EVERYONE:RX So this will set the permission of this shortcut file to only Read & Execute only! But after I set it, the user is still can modify.
      Please kindly advise.
      Please note and assume that user don't have Administration account or etc, that should be only have 1 account to logon to the computer.
       
      EDIT:
      I must disable inheritance to remove all others permissions like SYSTEM, ADMINISTRATORS, etc. Then only GRANT everyone for READ & EXECUTE only.
      But still the user can go to edit the permissions tho. Any advise?
    • gahhon
      By gahhon
      The original UDF is Metro UDF v5.1
      Recently, I have added new function to handle similar like SplashTextOn
      Func _Metro_SplashTextScreen($Flag, $Title = "", $Text = "", $mWidth = 600, $Fontsize = 11, $ParentGUI = "") Local $msgbDPI = _HighDPICheck() Local $SplashScreen_Form $iMsg = $Text If $Flag = 1 Then If $HIGHDPI_SUPPORT Then $mWidth = Round($mWidth * $gDPI) Else $Fontsize = ($Fontsize / $Font_DPI_Ratio) EndIf Local $LabelSize = _StringSize($Text, $Fontsize, 400, 0, "Arial", $mWidth - (30 * $msgbDPI)) Local $mHeight = 120 + ($LabelSize[3] / $msgbDPI) $SplashScreen_Form = _Metro_CreateGUI($Title, $mWidth / $msgbDPI, $mHeight, -1, -1, False, $ParentGUI) GUICtrlCreateLabel(" " & $Title, 2 * $msgbDPI, 2 * $msgbDPI, $mWidth - (4 * $msgbDPI), 30 * $msgbDPI, 0x0200, 0x00100000) GUICtrlSetBkColor(-1, _AlterBrightness($GUIThemeColor, 30)) GUICtrlSetColor(-1, $FontThemeColor) _GUICtrlSetFont(-1, 11, 600, 0, "Arial", 5) $iLableID = GUICtrlCreateLabel($Text, 15 * $msgbDPI, 50 * $msgbDPI, "", $LabelSize[3], -1, 0x00100000) GUICtrlSetBkColor(-1, $GUIThemeColor) GUICtrlSetColor(-1, $FontThemeColor) GUICtrlSetFont(-1, $Fontsize, 400, 0, "Arial", 5) GUISetState(@SW_SHOW) Return SetError(1, 0, "") ElseIf $Flag = 0 Then _Metro_GUIDelete($SplashScreen_Form) Return SetError(1, 0, "") Else Return SetError(0, "", "Error: Invalid flag value") EndIf EndFunc ;==>_Metro_SplashTextScreen Then I call it from my main application I got error display when exited. It didn't got any impact to the result, but just wondering why it show this error.
      This error only appear when my main application trigger this function, but not from my test application to trigger this function.
      Test application at here: Test Application

      This is the function code where trigger the error.

      Func _iMExit() For $i_HR = 0 To UBound($iGUI_LIST) - 1 Step +1 _Metro_GUIDelete($iGUI_LIST[$i_HR][0]) Next DllCallbackFree($m_hDll) _GDIPlus_Shutdown() EndFunc ;==>_iMExit ....... Func _Metro_GUIDelete($GUI) GUISetState(@SW_HIDE, $GUI) ;To prevent visible delay when the gui is being deleted _WinAPI_RemoveWindowSubclass($GUI, $m_pDll, 1010) GUIDelete($GUI) ;Remove from Global GUI List Local $CLEANED_GUI_LIST[0] For $i_HR = 0 To UBound($iGUI_LIST) - 1 Step +1 If $iGUI_LIST[$i_HR][0] <> $GUI Then ReDim $CLEANED_GUI_LIST[UBound($CLEANED_GUI_LIST) + 1][16] For $i_Hx = 0 To 11 Step +1 $CLEANED_GUI_LIST[UBound($CLEANED_GUI_LIST) - 1][$i_Hx] = $iGUI_LIST[$i_HR][$i_Hx] Next EndIf Next $iGUI_LIST = $CLEANED_GUI_LIST ;~ _ReduceMemory() EndFunc ;==>_Metro_GUIDelete Any idea what is going on?
      Because before this, I also got create another input function just for password purpose. (Duplicate & similar to _Metro_InputBox)
      But it didn't got any error display on console when exited.
×