rnagulapalle Posted October 26, 2014 Posted October 26, 2014 Hi, I have script that returns 1 when i use option "IsEnabled" or "IsVisible" for a checkbox on a window but its returning 0 for "IsChecked" option though the checkbox is checked. Does anyone have the same problem? Thanks Rj
guinness Posted October 27, 2014 Posted October 27, 2014 Nope. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
JohnOne Posted October 27, 2014 Posted October 27, 2014 Show example code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
AntoineV Posted November 13, 2014 Posted November 13, 2014 I have the same Issue. The problem come when I use another class then normal button class. In my script the class button is : WindowsForms10.Button.app.0.1ca0192_r13_ad1 This is a checkbok. ControlCommand ("Title","Text","[CLASS:WindowsForms10.BUTTON.app.0.1ca0192_r13_ad1;INSTANCE:12]","IsChecked","") What can we do ?
jdelaney Posted November 13, 2014 Posted November 13, 2014 Send the full output from the Control tab on the AutoIT Window Info tool...while focused on your checkbox. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
jdelaney Posted November 13, 2014 Posted November 13, 2014 (edited) Use the Name instead ConsoleWrite(ControlCommand ("Title","Text","[NAME:checkBoxRequireApproval]","IsChecked","") & @CRLF) If that doesn't do it...make sure you can grab the window handle with WinGetHandle Then, make sure you can get the control with ControlGetHandle Then use those handles in the Controlcommand function Use this to validate the handel returns: IsHWnd Edited November 13, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
AntoineV Posted November 13, 2014 Posted November 13, 2014 I have the handle of the Windows with WinActivate then I use the command Send to move into the Windows. So i guess I have th handle ? I have already use just the name and that doesn't work ... By the way thank you for your help and if my english is bad it's because Im french ! haha
Zedna Posted November 15, 2014 Posted November 15, 2014 Your ClassnameNN show it's not standard Windows contol (checkbox). AutoIt's ControlCommand can work only with standard Windows controls. Resources UDF ResourcesEx UDF AutoIt Forum Search
xian_lhm Posted August 14, 2018 Posted August 14, 2018 Hi, I'm a beginner of AutoIt. I have the same problem with checkbox state. I use ControlCommand to set the checkbox and it is worked. But before this command, I had to know the state of checkbox was checked or unchecked. I use GUICtrlRead("[NAME:checkBox1]") and it always return 0. Does anyone knows what happen? Thanks for help.
Developers Jos Posted August 14, 2018 Developers Posted August 14, 2018 GuiCtrlRead() is for you own developed GUI's. I assume you use ControlCommand() with "Check", so use "IsChecked" to check it's current status. Post your script when you still have issues. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
xian_lhm Posted August 18, 2018 Posted August 18, 2018 #include <Winapi.au3> #include <Array.au3> #include <MsgBoxConstants.au3> Local $I, $J, $sControl_ID Dim $ObjTitle = "Demo Form" Dim $aCheckBoxFlag[3][5] = [[1, 1, 0, 0, 1], _ [1, 1, 1, 1, 0], _ [0, 0, 0, 0, 1]] Dim $aCheckBoxName[5] = ["checkBox1", "checkBox2", "checkBox3", "checkBox4", "checkBox5"] $hWnd = WinWait($ObjTitle) ; Wait For Win App Exist $hWnd = WinActivate($ObjTitle) ; Activate Win App ; For $I = 0 To 2 For $J = 0 To 4 $sControl_ID = "[NAME:" & $aCheckBoxName[$J] & "]" ControlFocus($hWnd, "", $sControl_ID) ; Set Focus $Check_State = ControlCommand($hWnd, "", $sControl_ID, "IsChecked") MsgBox(0, $sControl_ID, $Check_State) If ControlCommand($hWnd, "", $sControl_ID, "IsChecked") Then ControlCommand($hWnd, "", $sControl_ID, "Uncheck") EndIf MsgBox(0, "$aCheckBoxFlag[" & $I & "][" & $J & "]", $aCheckBoxFlag[$I][$J]) If $aCheckBoxFlag[$I][$J] = 1 Then ; Check The Check Box ControlCommand($hWnd, "", $sControl_ID, "Check", "") EndIf Next Next The $Check_State of every check box is 0 no matter what the real checkbox ischecked or Unchecked. Thanks for help.
Zedna Posted August 20, 2018 Posted August 20, 2018 1) Try to use ClassNameNN as "controlID" instead of "[NAME:]" 2) Try ControlCommand(title, text, controlId, 'IsChecked','') instead of ControlCommand(title, text, controlId, 'IsChecked') Resources UDF ResourcesEx UDF AutoIt Forum Search
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