Jump to content

ControlCommand Failed to get state on Winform Platform - (Moved)


Go to solution Solved by Nine,

Recommended Posts

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

Link to comment
Share on other sites

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 by Leendert-Jan
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Solution

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...