Shoby Posted June 17, 2015 Posted June 17, 2015 Hello,I am working on .NET application which has checkboxes. So, i have to validate those checkbox controls whether they have checked or not.I have used following code to test these but none works for me..1. ControlCommand(("Task Wizard","","[NAME:chPrefixWSName]","IsChecked","") Returns 0. Same command for "IsEnabled", "Check" is working; "Uncheck" not working.2. GUICtrlRead("[NAME:chPrefixWSName]") Returns 03. GUICtrlGetState("[NAME:chPrefixWSName]") Returns -1Always returns false even though the checkbox is checked. Is there any problem with the environment or AutoIT?Can anyone help me on this ?
MilesAhead Posted June 17, 2015 Posted June 17, 2015 (edited) Try BM_GETCHECK messagewith _WinAPI_SendMessageTimeout()The timeout keeps your program from hanging if the target window does not respond.Edit: Somehow you have to get the hwnd of the target. Edited June 17, 2015 by MilesAhead My Freeware Page
Shoby Posted July 16, 2015 Author Posted July 16, 2015 Hello MilesAhead,The control which i am testing is not created with the BS_AUTOCHECKBOX, BS_AUTORADIOBUTTON, BS_AUTO3STATE, BS_CHECKBOX, BS_RADIOBUTTON, orBS_3STATE style .Could anyone suggest an alternative for this?
MikahS Posted July 16, 2015 Posted July 16, 2015 Hope these links within this link help you out: Link Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Shoby Posted July 16, 2015 Author Posted July 16, 2015 Hello Mikah , Thanks for the link. But the link is mostly about getting the .NET control handle. In my case i got the handle, Only thing is I couldnt get the state of the checkbox through autoIT as well as WInAPI.. Is there any other way or Autoit has its own limitations regarding to .NET checkbox control. I am confused..
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