Wellwellwell Posted November 10, 2021 Posted November 10, 2021 Hi All, I am checking a checkbox state on a Winform GUI, ControlCommand always return 0 regardless of the checkbox is being ticked/no-ticked I think there is a bug on the Autoit, my code as below: ControlCommand($gProdGUIName, "", "[NAME:Mid_checkBox]", "IsChecked", "") I use the same Autoit code on another GUI platform which is MFC based. The command ControlCommand is working flawlessly, it can return 0 when checkbox is unticked, return 1 when checkbox is ticked. Is this command not supported on Winform? Thanks Wellwellwell
Developers Jos Posted November 10, 2021 Developers Posted November 10, 2021 Moved to the appropriate forum. Moderation Team Wellwellwell 1 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.
Leendert-Jan Posted November 10, 2021 Posted November 10, 2021 (edited) Sometimes ControlCommand only works when the window is active. Have you tried activating it first? WinActivate($gProdGUIName) $iIsChecked = ControlCommand("[ACTIVE]", "", "[NAME:Mid_checkBox]", "IsChecked", "") MsgBox(64, "Is checked:", $iIsChecked) More Info: ControlCommand (look at the Remarks): https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm Edited November 10, 2021 by Leendert-Jan
Wellwellwell Posted November 11, 2021 Author Posted November 11, 2021 Hi Leendert-Jan, Thanks for your reply. I have tried your suggestion, it still would not work on Winform platform. The same code work on the MFC platform. Thanks
Leendert-Jan Posted November 15, 2021 Posted November 15, 2021 Hmm I see two other things that might help 1. Temporarily disable your antivirus. Some AV won't flag AutoIT scripts, but just simply stop them from doing certain things without any notifications. 2. Run your script as Administrator.
jguinch Posted November 15, 2021 Posted November 15, 2021 Do you have the same result by running the AutoIt script in 64 bits mode ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Wellwellwell Posted November 17, 2021 Author Posted November 17, 2021 Hi Leendert-Jan, I tested run as admistrator, not able to work as well for Winform platform. Sorry, i not able to test with antivrus off as there are some policy in the company on the laptop....you know.. Thanks for the suggestion anyway. Hi jguinch, Test it with compile and run in x64. The result are same. MFC platform build can work, Winform platform are still returning the state as 0; Thank you
Solution Nine Posted November 17, 2021 Solution Posted November 17, 2021 As described in this document from Microsoft, you could use UIAutomation to access Windows Form controls. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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