GetCheckBox always returns 0 (unchecked)

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kerwin
Newbie
Posts: 1
Joined: Thu Oct 05, 2006 9:44 pm

GetCheckBox always returns 0 (unchecked)

Post by kerwin » Thu Oct 05, 2006 9:54 pm

I'm trying to get the status of a checkbox in a tuning wizard, but the command is returning 0 as if the checkbox is unchecked regardless of it's actual state.

I have already checked for leading and trailing spaces. I've tried right-clicking the control and selecting "copy object caption". I even added a SetCheckBox True command just before that line, and it had no effect.

Here is a copy of the windows control text:
4261386 - WindowsForms10.BUTTON.app.0.378734a "Click here if you are using headphones"
And here is a copy of the line of code I have written:
GetCheckBox>Audio and Video Setup,Click here if you are using headphones,status
Any idea what the problem could be?

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Oct 06, 2006 3:49 am

hmm....has "Button" in the object name...have you tried to GetControlText or any other command to see what you can detect? As always, you might write a couple of lines of Image Recognition to detect the state...just compare bitmaps of a stored pic of the control both checked and unchecked...

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Oct 06, 2006 7:59 am

That is a WindowsForms (.NET) control and searching the various Microsoft .NET discussion forums it would seem there is a known problem with these checkbox controls that prevents them responding to the BM_GETCHECK and BM_SETCHECK messages. In other words, this appears to be a Microsoft bug.

Hopefully it will be fixed in later releases of .NET. But I will try to find out more.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts